!DOCTYPE是什么意思?

!DOCTYPE是什么意思?
!文档类型,一个文档类型标记是一种标准通用标记语言的文档类型声明,它的目的是要告诉标准通用标记语言解析器,它应该使用什么样的文档类型定义(DTD)来解析文档。
它告诉浏览器浏览的网页HTML的版本。

DOCTYPE
A document type declaration, or DOCTYPE, is an instruction that associates a particular SGML or XML document (for example, a webpage) with a document type definition (DTD) (for example, the formal definition of a particular version of HTML).




Title of the document


The content of the document……

Definition and Usage
The declaration must be the very first thing in your HTML document, before the tag.

The declaration is not an HTML tag; it is an instruction to the web browser about what version of HTML the page is written in.

In HTML 4.01, the declaration refers to a DTD, because HTML 4.01 was based on SGML. The DTD specifies the rules for the markup language, so that the browsers render the content correctly.

HTML5 is not based on SGML, and therefore does not require a reference to a DTD.

Tip: Always add the declaration to your HTML documents, so that the browser knows what type of document to expect.

发表评论

您的电子邮箱地址不会被公开。