preface
Internet Explorer 5.5 introduced the concept of document schema, which is implemented by using document type (DOCTYPE) toggles.
The document model
Document mode is mainly divided into hybrid mode and standard mode, while standard mode can be divided into standard mode, quasi-standard mode and super standard mode (standard mode and quasi-standard mode are very close, their differences are almost negligible). The specific distinction is shown as follows:
The standard model
This can be enabled by any of the following types:
HTML 4.01 strict
<! -- HTML 4.01 Strict --> <! DOCTYPE HTML PUBLIC"- / / / / W3C DTD HTML 4.01 / / EN"
"http://www.3c.org/TR/html4/strict.dtd">
Copy the code
XHTML 1.0 is strict
<! -- XHTML 1.0 strict --> <! DOCTYPE HTML PUBLIC"- / / / / W3C DTD XHTML 1.0 Strict / / EN"
"http://www.3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Copy the code
HTML 5
<! -- HTML 5 --> <! DOCTYPE HTML>Copy the code
Quasi standard mode
This can be triggered by the use of transitional or frameset, as follows:
HTML 4.01 transition type
<! -- HTML 4.01 Transition --> <! DOCTYPE HTML PUBLIC"- / / / / W3C DTD HTML 4.01 Transitional / / EN"
"http://www.3c.org/TR/html4/DTD/loose.dtd">
Copy the code
HTML 4.01 frameset type
<! HTML 4.01 frameset type --> <! DOCTYPE HTML PUBLIC"- / / / / W3C Frameset DTD HTML 4.01 / / EN"
"http://www.3c.org/TR/html4/frameset.dtd">
Copy the code
XHTML 1.0 is transitional
<! -- XHTML 1.0 transition --> <! DOCTYPE HTML PUBLIC"- / / / / W3C DTD XHTML 1.0 Transitional / / EN"
"http://www.3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Copy the code
XHTML 1.0 frameset type
<! -- XHTML 1.0 frameset --> <! DOCTYPE HTML PUBLIC"- / / / / W3C DTD XHTML 1.0 Frameset / / EN"
"http://www.3c.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
Copy the code
Super Standard mode
IE8 default mode, but its default mode can be turned off by:
<meta http-equiv="X-UA-Compatible" content="IE=7" />
Copy the code
IE is used to specify which version of the rendering engine to use to render pages, with the goal of backward compatibility with sites and pages designed specifically for older versions of IE.
reference
JavaScript Advanced Programming
summary
This article focuses on several HTML document modes and their differences (see the illustration).
If you have any questions, please point out.