This is what <!DOCTYPE>
you need to know after you know it.
- DOCTYPE can declare three DTD types, each representing a strict version, a transition version, and a framework-based HTML document.
- When browser vendors start to create a standard-compatible browser, they want to ensure backward compatibility. To achieve this, they created two rendering modes: standard mode and promiscuous mode
- In standard mode, the browser renders the page with the highest standards it supports;
- In promiscuous mode, the page is displayed in a more relaxed backward-compatible manner. Promiscuous mode typically simulates the behavior of older browsers to prevent old sites from working.
- Mode Trigger
The browser chooses the rendering method to use based on whether the DOCTYPE exists and which DTD to use.
- If XHTML, HTML 4.01 documents contain a full form of doctype, then it is generally rendered in standard mode.
- DOCTYPE that contain transition DTDs and URIs also cause the page to render in standard mode, but having a transition DTD without a URI causes the page to be rendered in promiscuous mode.
- DOCTYPE is not present or incorrect in form causes HTML and XHTML documents to be rendered in promiscuous mode.
HTML5 since there is no DTD, there is no strict mode and relaxed mode of the difference, HTML5 has a relatively loose syntax, when implemented, has been as large as possible to achieve backward compatibility.
Html_ Strict mode and promiscuous mode