![](/img/trans.png)
[英]W3C HTML5 ERROR Start tag head seen but an element of the same type was already open
”和“開始標簽
看到了,但是相同類型的元素已經打開了” - 堆棧內存溢出[英]W3C HTML validation errors: “Stray end tag </head>” and “Start tag <body> seen but an element of the same type was already open”
經過W3C驗證程序驗證后,這部分代碼會產生2個錯誤:
流浪結束標簽
</head>
起始標簽
<body>
可見,但是相同類型的元素已經打開
<!DOCTYPE html>
<html lang="en">
<head>
<title> Chatter </title>
<h1> Welcome to Chatter|app! </h1>
<style>
body {
background-color: #e0e0e0;}
</style>
</head>
<body>
<h4> #Food </h4>
<h4> #Movies </h4>
<h4> #SpaceX </h4>
<h4> #Thingstodo </h4>
<h4> #Chatter </h4>
<input type= "button" value= "New" />
<input type= "button" value= "Trending" />
<input type= "button" value= "Favorites" />
</body>
</html>
只需將h1
元素從頭部連接移動到身體部分
<!DOCTYPE html>
<html lang="en">
<head>
<title> Chatter </title>
<style>
body {
background-color: #e0e0e0;
}
</style>
</head>
<body>
<h1> Welcome to Chatter|app! </h1>
<h4> #Food </h4>
<h4> #Movies </h4>
<h4> #SpaceX </h4>
<h4> #Thingstodo </h4>
<h4> #Chatter </h4>
<input type="button" value="New" />
<input type="button" value="Trending" />
<input type="button" value="Favorites" />
</body>
</html>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.