[英]W3C HTML validation errors: “Stray end tag </head>” and “Start tag <body> seen but an element of the same type was already open”
This part of the code, when validated by W3C validator, gives 2 errors: 经过W3C验证程序验证后,这部分代码会产生2个错误:
Stray end tag
</head>
流浪结束标签
</head>
Start tag
<body>
seen but an element of the same type was already open起始标签
<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>
Just move the h1
element from head seaction to body section 只需将
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.