<! DOCTYPE> label definition and usage, doctype label
<! DOCTYPE> the declaration is not an HTML Tag; it indicates the web browser's instructions on which HTML version the page is written.
In HTML 4.01, <! DOCTYPE> declare to reference DTD because HTML 4.01 is based on SGML. The DTD specifies the markup language rules so that the browser can correctly render the content.
HTML5 is not based on SGML, so you do not need to reference DTD.
W3c suggestion: always add to HTML document <! DOCTYPE> declaration so that the browser can know the document type.
SGML is an international standard language that defines the structure and description of electronic documents. SGML is not a document language, but it describes a document language, so it is a metalanguage.
Common DOCTYPE declarations
There are three types in HTML 4.01 <! DOCTYPE> declaration. There is only one type in HTML5:
HTML 5
<! DOCTYPE html>
HTML 4.01 Strict
This DTD contains all HTML elements and attributes, but does not include explicit and obsolete elements (such as font ). Framesets is not allowed ).
<! Doctype html public "-// W3C // dtd html 4.01 // EN" "http://www.w3.org/TR/html4/strict.dtd">
HTML 4.01 Transitional
This DTD contains all HTML elements and attributes, including explicit and obsolete elements (such as font ). Framesets is not allowed ).
<! Doctype html public "-// W3C // dtd html 4.01 Transitional // EN" "http://www.w3.org/TR/html4/loose.dtd">
HTML 4.01 Frameset
This DTD is equivalent to HTML 4.01 Transitional, but allows the content of the framework set.
<! Doctype html public "-// W3C // dtd html 4.01 Frameset // EN" "http://www.w3.org/TR/html4/frameset.dtd">