【问题标题】:Getting "Stray end tag html" from W3C Validator从 W3C Validator 获取“Stray end tag html”
【发布时间】:2012-12-10 13:27:31
【问题描述】:

我正在使用 W3C 的 validator 检查我的 (HTML5) 网站并收到以下错误:

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

并且错误标志在关闭的“>”上。 那条线有什么问题?似乎完全正确。

【问题讨论】:

标签: html


【解决方案1】:

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

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

你至少应该有这个结构

【讨论】:

  • 谢谢。事实证明,MasterPage 在 html 标记之前有一些东西。无论如何,谢谢你的回答。
  • 不,最小值只是&lt;!doctype html&gt;&lt;title&gt;&lt;/title&gt;。我看不出这个答案如何解决所提出的问题以及为什么它被批准。
  • 来自w3c.org doc The root element of this tree is the html element, which is the element always found at the root of HTML documents. 我从那里读到html标签是 always 在根。恕我直言,这意味着它是强制性的。然而 HTML5 验证器是 experimenal
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-09-25
  • 2012-03-17
  • 2012-01-17
  • 2012-06-28
相关资源
最近更新 更多