需要帮助解决多余的结束标签(HTML)错误



以下代码用于其中一个类。我们被要求为我们的一个项目制作一个网站。我们的教授总是希望在我们交作业之前通过一个验证器。我得到了这个错误,错误:偏离结束标签HTML。我不知道问题出在哪里。网站工作正常,但验证器告诉我有一个问题。如果您能帮助解决这个问题,我将不胜感激。

<!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>

如果一个标签没有像段落那样的开始和结束标签,例如:

<p>. .</p> 

那么它应该自闭:

<Img src .... />

因此,我建议在meta、style、img和br元素的尖括号前添加正斜杠。

请尝试这样做,看看它是否仍然无法验证

XHTML比HTML更严格,要求所有打开的标记必须关闭,即使它们不是容器标记。因此,非容器标记以/>结尾。例如,换行的标记是<br />

最新更新