In HTML, the formatting is all messed up - html

Here is the code:
<html>
<head>
<title> ATS Business and Games - Home </title>
<link rel="stylesheet" type="text/css" href="formatting.css"/">
<meta name= "description" content="This page has our rules along with links to our external and internal download pages.">
<meta name="keywords" content="ATS ats business and games video tutorials video videos tutorial minecraft">
</head>
<!-------------------------------------------------------------------------------------------------------------------------------->
<body>
<a href="http://atsbusinessandgames.co.cc">
<div class="toper" align="top">
<p style="color:white"> ATS Business and Games <img align="right"
src="http://atsbusinessandgames.co.cc/pictures/business-logo-small-with-tag-line.GIF" alt="ATS Business and Games Logo with tag line"
width=115px height=100px> </p>
</div>
</a>
<!-------------------------------------------------------------------------------------------------------------------------------->
<div class="navt">
<p style="text-align:center;color:white"> Home
</div>
<!-------------------------------------------------------------------------------------------------------------------------------->
<p> <span><b><font size="5" color="black"><h1>Rules for Downloads</h1></b></font>
<font size="4" color="black">Please note that this section is here to protect both us and you.
Proceeding to any download page beyond this assumes that you have read and understood all these rules.
If you have any questions then you may contact us (the link can be found at the bottom of every page).
<!-------------------------------------------------------------------------------------------------------------------------------->
<div class="bottom" align="bottom">
<p style="text-align:center;color:white"> Copyright (C) 2011
<a href="mailto:info#atsbusinessandgames.co.cc?subject=Information Request&body=What information would you like. We will try and get to you as soon
as possible!%0A%0A">Contact Us</a> </p>
</div>
</body>
</html>
So you can see how the formatting looks here is the link to the page:
http://www.atsbusinessandgames.co.cc/Downloads
and here is what the formatting of the page should look like:
http://www.atsbusinessandgames.co.cc/
Can someone please tell me how I can fix the formatting?
Note: I am working on the page so the body code may look a little different (as in more paragraphs). If I make any major changes I'll post them here otherwise right click then left click on view source.

You should refer to ../formatting.css instead of formatting.css in the Downloads part.
Also, there is a " at the end which shouldn't be there, but I don't think it's a problem for any browsers
<link rel="stylesheet" type="text/css" href="../formatting.css"/>

Related

Using img tag in HTML but image wont show

I'm using vscode for coding HTML but I have an issue.
When I want to use an img tag in HTML and use an image URL from the internet its OK but when I want to add a local image to the HTML it won't add and the image doesn't show but I can see that there is an image that hasn't been load.
I used both the Copy path and the Relative path and both don't work.
I'm going to share the code and site preview down below:
As you can see in the first image using a URL is ok but using a local image is not.
Can someone help me out with this?
cause I can't use any png format for the site.
if you need the whole page code its down below:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Foals</title>
<h1>Foals</h1>
<nav>
<ul>
<li>
Home
</li>
<li>Songs</li>
<li>
About
</li>
</ul>
</nav>
</head>
<body>
<section>
<img
src="https://i1.sndcdn.com/avatars-SN5qocZtZGc5mtdW-wNfltQ-t500x500.jpg"
width="250"
height="250"
/>
</section>
<h2>Foals in a sight :</h2>
<p id="SummeryInMain">
Foals, stylized as FOALS, are a British rock band formed in Oxford in
2005. The band's current line-up consists of a Greek-born lead vocalist and
guitarist Yannis Philippakis, drummer and percussionist Jack Bevan and
rhythm guitarist Jimmy Smith. They are currently signed to Warner Records,
and have released ix studio albums s to date: Antidotes (2008), Total Life
Forever (2010), Holy Fire (2013), What Went Down (2015), and Everything
Not Saved Will Be Lost – Part 1 & 2 (2019), while their forthcoming
the seventh album, Life Is Yours is scheduled to be released in June 2022.
They have also released one video album, six extended plays and
thirty-three singles. The band have toured internationally for over a
decade, and have featured at many festivals including Glastonbury,
Coachella, and Roskilde.They have won a number of awards, including best
live act at the 2013 Q Awards while producers Alan Moulder and Flood were
awarded 'UK Producer of the Year' for their work on the album Holy Fire.
<br />
<br />
For more info about foals visit Here
</p>
<h2>Concerts on the way in:</h2>
<table>
<tr>
<td>Date</td>
<td>Place</td>
<td>Ticket</td>
<td>Available on</td>
</tr>
<tr>
<td>2022/4/30</td>
<td>Glastonbury</td>
<td>49£</td>
<td>
<a href="https://www.gigsandtours.com/tour/foals" target="-blank">
Gigsandtours
</a>
</td>
</tr>
</table>
<h4>FOALS on social media:</h4>
<nav>
<!-- Spotify link -->
<a
href="https://open.spotify.com/artist/6FQqZYVfTNQ1pCqfkwVFEa"
target="_blank"
>
<img
src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS6b3KKKOIKpFmjWkESxGgJKwgcXHkx19buzA&usqp=CAU"
width="70"
height="70"
/></a>
<!-- Youtube link -->
<a
href="https://www.youtube.com/channel/UCnnumwiwZd1JWZWpiyqF0gQ"
target="_blank"
>
<img src="youtube.png" />
</a>
</nav>
</body>
</html>
Change your image tag to this:
<img src="../Photos/youtube.png" />
Here's how this works
.. Go back from your HTML files Folder
/Photos Go to your Photos folder
/youtube.png get a file named youtube.png
You have to make sure that the image you want to be added is in the same folder as the HTML file, only in that case you can specify just the name of the image without the path. If the image is in the other folder, put it in the same with the HTML file or write a full path like C:\Users\Username\folder\image.png
Is the location of the image correct? Include .jpg extension and also, Use alt attribute, so that you can specify an alternate text for the image.
Firstly confirm image is in the same folder where's your html file
define width and height of the img
confirm use of right extension of image like .jpg, .png

Need help resolving stray end tag (HTML) error

The following code is for one of the classes. We were instructed to make a website for one of our projects. Our professors want to always run it through a validator before we turn it in. I got this error, Error: Stray end tag HTML. I can not figure out where the issue is. The website works fine but the validator tells me there is a problem. Any help resolving this would be greatly appreciated.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Alex's T's and V's</title>
<link rel="shortcut icon" href="images/logo3.png"/>
<link rel="stylesheet" href="Styles/normalize.css"/>
<link rel="stylesheet" href="Styles/final.css"/>
</head>
<body>
<header>
<img src="images/logo.png" alt="Logo"/>
<h1>Welcome to the Ultimate T Shirt and V Neck Store</h1>
<h3>Enjoy your time and please stay as long as you would like</h3>
</header>
<main>
<h2>Welcome to my small T shirt store please feel free to browse</h2>
<br/>
<p> This is a small store meant to sell a few graphic T shirt and V neck designs. It has always been my goal to own my own store and this feels like the first step.
Being a successful entrepreneur has always been a dream of mine and I will work hard to make sure my goal is accomplished.
</p>
<br/>
<p> Below you will find a small selection of Anime inspired graphic T shirts and V neck that are listed at competitive prices. <br/> <strong>Note: Sizes available are Small, Medium, Large and Extra Large.</strong> </p>
<br/>
<div class="row">
<div class="column">
<img src="images/Tshirt1.jpg" alt="tshirt1" style="width: 48%;"/>
<p><br/>"The Crew" 19.99</p>
</div>
<div class="column">
<img src="images/tshirt2.jpg" alt="tshirt2" style="width: 45%;"/>
<p><br/>"Squad" 18.99</p>
</div>
<div class ="column">
<img src="images/tshirt3.jpg" alt="tshirt3" style="width: 50%;"/>
<p><br/>"Ninetails T" 21.99</p>
</div>
</div>
<h3>More Products Coming</h3>
<br/>
<p> As we grow as a company our selction will grow too! We plan to add more product and improve our designs based on consumer feedback.<br/> We thank you for your time and support. We look forward to seeing you again! Have a nice day and don't forget, shop Alex's T's and V's for the best T shirts around.</p>
</main>
<footer>
<p>© 2021 Alex's T's and V's</p>
</footer>
</body>
</html>
If a tag doesn't have an opening and closing tag like a paragraph for example:
<p>. .</p>
Then it should self close:
<Img src .... />
Therefore I recommend adding forward slash before closing angle bracket on your meta, style, img and br elements.
Please try doing that and see if it still fails to validate
XHTML is more strict than HTML, and requires that all open tags must be closed, even if they're not container tags. Therefore, non-container tags end in />. For example, the tag for a line break is <br />.

how to use image in visual code it's not working?

Image is not showing in browser using the image tag where am i wrong?
i want to add image in web and i am unable to do it using in visual code i don't know where from image to be added in the URL of image so anyone guide.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sign up </title>
</head>
<body>
<div class="Header">
<a href="/" class="LogoWrapper" >
<img src="D:\my-angular-projects\signup-form\src\image\Snap.jpg" alt="Scone O'Clock logo" />
</a>
<p class="Strap">Scones: the most resplendent of snacks </p>
</div>
<div class="IntroWrapper">
<p class="IntroText">
Occasionally maligned and misunderstood; the scone is a quintessentially British classic.
</p>
<div class="MoneyShot">
<img class="MoneyShotImg" src="D:\my-angular-projects\signup-form\src\image\1555932407.jpg" alt="Incredible scones" />
<p class="ImageCaption">Incredible scones, picture from Wikipedia</p>
</div>
</div>
<p>Recipe and serving suggestions follow.</p>
<div class="Ingredients">
<h3 class="SubHeader">
Ingredients</h3>
<ul>
</ul>
</div>
<div class="HowToMake">
<h3 class="SubHeader">Method</h3>
<ol class="MethodWrapper">
</ol>
</div>
</body>
</html>
the problem is that your file retrieves the image based on where the html file is somewhere and it does not check the entire computer hard drive.
So if you want the problem fixed you can start from the html files location basically. So if your html file is in the src folder your img tag shall be
<img src="image/1555932407.jpg">
else if you have your html file in the signup-form folder i shall work with this
<img src="src/image/1555932407.jpg">
Hopefully you found this useful otherwise just comment this post.
Visual Studio Code automatically retrieves files from the root directory, so it lists all of the files for you - making it easier to implement images and other stuff. It's one of the main reasons I use VSCode.
The image location depends on where your HTML file is. Use forward slashes when specifying folders/files, and use ../ to go up a directory.

My HTML file won't link to other HTML files or CSS

I am using Sublime text to write some HTML and CSS files. I've created my index.html:
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Meta -->
<meta charset="UTF-8" />
<title>RainyDayBakes</title>
<!-- Styles -->
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<h1 style="text-align:center">RainyDayBakes</h1>
<nav style="text-align:center">
<a href=”C:\Users\sarah\Documents\Simmons\CS-321\page1.html”> About </a>
<a href=”page2.html”> Menu </a>
<a href=”page3.html”> Gallery </a>
<a href=”page4.html”> Order </a>
<a href=”page5.html”> Contact Us </a>
</nav>
<img src="cake.png" alt="oreo crumble cake" class="center">
<h3>Welcome to RainyDayBakes!</h3>
<p>We are a local bakery specializing in creative cakes, cupcakes and cookies!</p>
<p>In addition to being open daily we also offer custom ordered confections.</p>
<!-- Scripts -->
<script src="scripts/index.js"></script>
</body>
<footer>
</footer>
</html>
my page1.html:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>This is Page One </title>
</head>
<body>
</body>
<footer>
</footer>
</html>
and my style.css:
<style>
h1 {
color:red;
}
</style>
When I try to run index.html in Chrome, the link to page1.html says it doesn't exist, and the CSS won't show up. They're all in the same folder, I've saved all the files, and I'm running on Chrome. Every other solution I've found refers to making a typo, the directories being different, etc. but as said, they're all in the same folder, and I haven't noticed a typo (but it's entirely possible when you're too close to your code).
First off, you're not even using the tag anywhere in your code, so that's why the style isn't showing up. Secondly, if they are in the same folder, just link your about page to page1.html; not the full directory listings.
You are using typographical quotes in your links' href attributes, which won't work. Change those to regular quotes.
Let the link be this way instead href=”page1.html”
You might want to put a link to your CSS file on all your pages, I don't see it on your page1.html You probably already know about this resource but I mention it just in case you don't: W3 Schools is very handy for a quick reference to a lot of HTML/CSS questions.
So you have two issues:
For page1.html, would suggest adding file:// or file:/// to the beginning of the href element, or maybe retyping the line since the other links worked
For your CSS, remove the tag, it's for when you put the style inside the HTML file(embedded)
This isn't an issue with your code. I was having the same exact problem too and i recently discovered that the problem likely lies in the IDE that you're using. I was using stackblitz and recived the same output. But when i switched to an online compiler and litteraly copy & pasted the code with the same file names, the code started working correctly. Try using an online compiler and see how that works out for you. It worked for me.
The compiler I used is:
https://www.onlinegdb.com/
make sure to switch the languate to HTML using the language dropdown on the top right corner.

My HTML links wont take me to my other HTML files

I am having trouble linking my HTML pages together. My code is below.
I have anchored the links the best way I know how to, but when I put them in HTML format and click on the hyperlink, it tells me the file cannot be found.
I have three pages I need to link together, and before I test it out, I put them all in one folder on my desktop and try to pull them up and I run into that error.
Here is my code. For ease of access, they are divided by headers of INDEX, SERVICES, and CONTACT. However, they are three separate html files.
<!DOCTYPE html>
<html lang=“en”>
<head>
<title>Trillium Media Design</title>
<meta charset=“utf-8”>
</head>
<body>
<header>
<h1>Trillium Media Design</h1>
</header>
<nav>
<b> <a href=“index.html”>Home</a>
<a href=“services.html”>Services</a>
<a href=“contact.html”>Contact</a>
</b>
</nav>
<main>
<h2>New Media and Web Design</h2>
<p>Trillium Media Design offers a comprehensive range of services to take your company's Web presence to the next level.</p>
<h3>Meeting Your Business Needs</h3>
<p>Our expert designers will listen to you as they create a website that helps to promote and grow your business.</p>
<footer>
<small><i>Copyright © 2018 Michael Vitucci</i></small></footer>
</body>
</html>
SERVICES
<!DOCTYPE html>
<html lang=“en”>
<head>
<title>Trillium Media Design-Services</title>
<meta charset=“utf-8”>
</head>
<body>
<header>
<h1>Trillium Media Design</h1>
</header>
<nav>
<b> <a href=“index.html”>Home</a>
<a href=“services.html”>Services</a>
<a href=“contact.html”>Contact</a>
</b>
</nav>
<main>
<h2>Our Services Meet Your Business Needs</h2>
<dl>
<dt><strong>Website Design></strong></dt>
<dd>Whether your needs are large or small, Trillium can get you on the Web!</dd>
<dt>strong>E-Commerce Solutions</strong></dt>
<dd>Trillium offers quick entry into the e-commerce marketplace.</dd>
<dt><strong>Search Engine Optimization</strong></dt>
<dd>Most people find new sites using search engines. Trillium can get your website noticed.</dd>
</dl>
<footer>
<small><i>Copyright © 2018 Michael Vitucci</i></small></footer>
</body>
</html>
CONTACT
<!DOCTYPE html>
<html lang=“en”>
<head>
<title>Trillium Media Design-Contact</title>
<meta charset=“utf-8”>
</head>
<body>
<header>
<h1>Trillium Media Design</h1>
</header>
<nav>
<b><a href=“index”>Home</a>
<a href=“services”>Services</a>
<a href=“contact”>Contact</a>
</b>
</nav>
<main>
<h2>Contact Trillium Media Design Today</h2>
<ul>
<li>E-Mail:
<a href=“mailto:contact#trilliummediadesign.com”>contact#trilliummediadesign.com</a>
</li>
<li>Phone: 555-555-5555</li>
</ul>
<footer>
<small><i>Copyright © 2018 Michael Vitucci</i></small></footer>
</body>
</html>
NEW CODE taken from browser source of Index page.
<!DOCTYPE html>
<html lang=“en”>
<head>
<title>Trillium Media Design</title>
<meta charset=“utf-8”>
</head>
<body>
<header>
<h1>Trillium Media Design</h1>
</header>
<nav>
<b> Home
Services
Contact
</b>
</nav>
<main>
<h2>New Media and Web Design</h2>
<p>Trillium Media Design offers a comprehensive range of services to take your company's Web presence to the next level.</p>
<h3>Meeting Your Business Needs</h3>
<p>Our expert designers will listen to you as they create a website that helps to promote and grow your business.</p>
<footer>
<small><i>Copyright © 2018 Hannah Markel</i></small></footer>
</body>
</html>
This is the browser URL I get from the Index page.
file:///C:/Users/Michael%20Vitucci/Desktop/michaeltest/michaelindex.html
This is the browser URL I get from the error page.
file:///C:/Users/Michael%20Vitucci/Desktop/michaeltest/index.html
You are using typographic quotation marks, while you should use double quotes (and this applies to all attributes). For example, instead of: Home.
check all these files are in the same directory as index.html?, else you have to mention relative path from the directory where these files are kept and if they are in same directory still issue try like "./services.html"
<b> Home
Services
Contact
</b>
Have you tried adding the whole address?
Home
Are these files are on the same level, i.e is index.html and about.html placed in same folder if they are placed in the same folder you can directly access that file via "./about.html" from index.html file, if the files are placed in different folders at the same level, then you need to go up one level i.e "../about/about.html";
p.s to avoid any typos you can use tools like emmet for HTML, and to avoid path mismatch issues you can use extensions like path Intellisense.
(Emmet and path Intellisense are extensions available in vs code).