从 W3C Validator 获取“Stray end tag html”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13801917/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 04:18:03  来源:igfitidea点击:

Getting "Stray end tag html" from W3C Validator

html

提问by ispiro

I'm checking my (HTML5) site using W3C's validatorand getting the following error:

我正在使用 W3C 的验证器检查我的 (HTML5) 站点 并收到以下错误:

Stray end tag html. 
<html lang="en-US">

And the error sign is on the closing ">" there. What is wrong with that line? It seems to be exactly right.

错误标志在那里的结束“>”上。那条线有什么问题?似乎完全正确。

采纳答案by bart s

this is the minimum html that validates as html5 (except for the lang="en-US")

这是验证为 html5 的最小 html(除了lang="en-US"

<!DOCTYPE html>
<html lang="en-US">
  <head>
    <title></title>
  </head>
  <body>
  </body>
</html>

You should have at least this structure

你至少应该有这个结构