HTML 5 <! Doctype> Label
Definitions and usage
<! The doctype> declaration must be in the first line of the HTML5 document, before the
DOCTYPE declaration does not belong to HTML tags; tag; It is an instruction that tells the browser the version of the markup used to write the page.
It is important to specify DOCTYPE in all HTML documents so that the browser can understand the expected document type.
The DOCTYPE in HTML 4.01 needs to refer to DTDs because HTML 4.01 is based on SGML. While HTML 5 is not based on SGML, there is no need to refer to DTDs, but DOCTYPE is needed to regulate the behavior of browsers (let browsers run the way they should). )。
Instance
HTML5 document with the correct document type (DOCTYPE):
<! DOCTYPE html>
The difference between HTML 4.01 and HTML 5
There are 3 different document types in HTML 4.01, and only one in HTML 5:
<! DOCTYPE html>
In HTML5, the document type declaration is not very simple.
Tips and Comments:
Note: <! doctype> tag has no end tag!
Hint: <! Doctype> is not sensitive to case.
Property
NONE