Home > database >  Need help resolving stray end tag (HTML) error
Need help resolving stray end tag (HTML) error

Time:10-26

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>&copy; 2021 Alex's T's and V's</p>
    </footer>
</body>
</html>

CodePudding user response:

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

CodePudding user response:

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 />.

  •  Tags:  
  • html
  • Related