DOCTYPE is a shorthand for document type, which is an essential key component of the DOCTYPE declaration to create a page that conforms to the standard.
2017-05-20
label definition and usage instructions
<! The doctype> declaration is located in the first position in the document, before the declaring the document's parsing type (document.compatmode), avoiding the browser's bizarre pattern;
1 <! DOCTYPE html> 2
<! The doctype> declaration is not an HTML tag; it is used to tell the Web browser which HTML version the page is using;
In HTML 4.01, <! The doctype> declaration requires a reference to a DTD (document type declaration) because HTML 4.01 is based on SGML (Standard generalized Markup Language-generic Markup language). The DTD specifies the rules of the markup language to ensure that the browser renders the content correctly;
HTML5 is not based on SGML and therefore does not require a reference DTD;
<! The doctype> declaration does not have an end tag and is not case sensitive.
Css1compat: Standard mode, browser using the standard resolution rendering page; Backcompat: Weird mode, the browser uses its own weird mode to parse the rendered page.
Common DOCTYPE declarations
HTML 5
<! DOCTYPE HTML >
There are 3 types of DTD (document type definition) declarations in HTML4.01 that can be selected: transitional (Transitional), Strict (Strict), and Frame (Frameset).
HTML4.01 Transitional
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd " >
HTML4.01 Strict
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01//en" "HTTP://WWW.W3.ORG/TR/HTML4/STRICT.DTD" >
HTML4.01 Frameset
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 frameset//en" "Http://www.w3.org/TR/html4/frameset.dtd " >
Reference: More
<! Doctype> about the first line of an HTML document