The 1.Doctype declaration, located at the front of the document, precedes the label, which tells the browser which HTML or XHTML specification to use, which declares three DTD types, representing strict, transitional, and framework-based HTML documents, respectively.
2. When browser vendors start to create a standard-compatible browser, they divide the browser's working mode (rendering mode) into standard mode and promiscuous mode to ensure backward compatibility. In standard mode, the browser renders the page according to the specification, and in promiscuous mode, the page is displayed in a more relaxed backward-compatible fashion, which typically simulates the behavior of older browsers to prevent old sites from working.
3. How do I trigger these two modes?
1) Add the XML header declaration, can trigger the quirks mode of IE browser. After triggering, the browser parses the same way as IE5.5, with IE5.5-like bugs and other problems, as well as behavior (Javascript).
2) Trigger IE6 Promiscuous mode: Add XML declaration before XHTML DOCTYPE
<?xml version= "1.0" encoding= "Utf-8"? ><! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 strict//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >.
3) Trigger IE7 Promiscuous mode: Add HTML comment between XML declaration and XHTML doctype <?xml version= "1.0" encoding= "Utf-8"?><!--... and keep IE7 in Quirks Mode--><! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 strict//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >.
4) IE6 and IE7 can be triggered: in HTML4.01 DOCTYPE document header, add HTML comment <!--quirks mode--<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01//en" "Http://www.w3.org/TR/html4/strict.dtd" >.
5) Add <! at the top of the page DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" > will trigger "weird mode".
6) When you do not use DTD declarations or use HTML4 (not including HTML4) for DTD declarations, basically all browsers are rendered using quirks mode.
How to understand doctype? What is strict mode and promiscuous mode? How do I trigger both of these modes?