简体   繁体   English

Dreamweaver html 验证问题:“标签必须配对”

[英]Dreamweaver html validation issue: "Tag must be paired"

I'm wondering if this is a quirk in Dreamweaver: The first tag in my html5 document is:我想知道这是否是 Dreamweaver 中的一个怪癖:我的 html5 文档中的第一个标签是:

<!doctype html>

...and the last tag is: ...最后一个标签是:

</html>

When validating the document (W3C) from within Dreamweaver, I get this error:从 Dreamweaver 中验证文档 (W3C) 时,我收到此错误:

Tag must be paired, no start tag: [ </html> ]标签必须成对,没有开始标签:[ </html> ]

Could it be that Dreamweaver doesn't recognize the first tag with?doctype?会不会是 Dreamweaver 无法识别带有 ?doctype 的第一个标签?

<!doctype html> is not an opening-tag. <!doctype html>不是开始标签。 It's an SGML doctytpe declaration.这是一个 SGML doctytpe 声明。

The <html> opening tag goes after it, like so: <html>开始标记在它之后,如下所示:

<!doctype html>
<html>
    <head>
    </head>
    <body>
    </body>
</html>


Backstory: SGML doctype declarations are usually far more complicated, and when HTML was ostensibly an application of SGML (eg in HTML4.01) then HTML documents needed full-form SGML DTDs like this:背景故事:SGML doctype 声明通常要复杂得多,当 HTML表面上是 SGML 的应用程序(例如在 HTML4.01 中)时,HTML 文档需要像这样的完整格式的 SGML DTD:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

...however, ever since HTML5 was declared as "a living standard" without version numbers, and no-longer either SGML nor XML (rip XHTML) there was no need for a HTML5 DTD anymore, but for compatibility purposes the W3C and WHATWG said that <!doctype html> (without the older SGML PUBLIC / SYSTEM parts, and without a URI to the actual DTD) should be used. ...但是,自从 HTML5 被宣布为没有版本号的“生活标准”以来,SGMLXML(撕裂 XHTML)都不再需要 Z6BFF62B10D884FB77428CWHTDFE168CD87说应该使用<!doctype html> (没有旧的 SGML PUBLIC / SYSTEM部分,并且没有实际 DTD 的 URI)。

See here for details: Where is the HTML5 Document Type Definition?有关详细信息,请参见此处: HTML5 文档类型定义在哪里?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM