简体   繁体   English

HTML4.01中的DTD

[英]DTD in HTML4.01

The purpose of a DTD (Document Type Definition) is to define the legal building blocks of an XML document. DTD(文档类型定义)的目的是定义XML文档的合法构件。 So Why it is used in HTML 4.01 as Doctype ? 那么,为什么在HTML 4.01中将它用作Doctype?

And what about HTML5 If it is not using dtd then how can we validate HTML5 documents. 那么HTML5呢?如果不使用dtd,那么我们如何验证HTML5文档。 Do we have to write our custom DTD here ? 我们是否需要在此处编写自定义DTD?

The purpose of a DTD (Document Type Definition) is to define the legal building blocks of an XML document. DTD(文档类型定义)的目的是定义XML文档的合法构件。

SGML documents too. SGML文件也是如此。

So Why it is used in HTML 4.01 as Doctype ? 那么,为什么在HTML 4.01中将它用作Doctype?

Because HTML 4 is an SGML application and makes use of the pre-existing work done to make SGML useful. 因为HTML 4是SGML应用程序,并且利用了已有的工作使SGML有用。

And what about HTML5 还有HTML5

The authors of HTML 5 decided that since browser vendors all implemented tag soup parsers instead of SGML parsers, HTML 5 wouldn't be an SGML application. HTML 5的作者决定,由于浏览器供应商都实现了标签汤解析器而不是SGML解析器,因此HTML 5不会成为SGML应用程序。

If it is not using dtd then how can we validate HTML5 documents. 如果未使用dtd,那么我们如何验证HTML5文档。

To validate an HTML 5 document you need to use an HTML 5 validator instead of a general SGML validator. 要验证HTML 5文档,您需要使用HTML 5验证器而不是常规的SGML验证器。

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

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