What is the role of Doctype? What are the differences between standard (strict) and weird (mixed) modes ?, Doctype Hybrid
What is the role of Doctype? What are the differences between standard (strict) and weird (mixed) modes?The following standard mode and strict mode are collectively referred to as standard mode, while the weird mode and mixed mode are collectively referred to as weird mode. I only want to talk about the problem. I want to know more about the browser. Study the browser development history by myself. Haha. <! DOCTYPE> the Document declaration must be the first line of the HTML document, located before the
<! DOCTYPE html>
Why should I use such a statement?Just define <! DOCTYPE html>, your browser will render the page in standard mode, otherwise it will render the page in weird mode.
What is the standard mode and the weird mode?Standard mode: the browser parses and renders pages according to W3C standards. Weird mode: the browser parses and renders pages in its own way.
Why is there a weird pattern?In the early days, browsers were not strictly designed to comply with W3C standards for a period of time. In order to be compatible with the web pages generated during this period, a page rendering mode was generated. To differentiate between the old and new web pages, use the doctype document statement. If a Web page does not specify the document type (the old web page does not have the document type at all ), then the browser automatically uses the "weird mode" to render the page, so that the old page can survive normally. If the document type is specified, the rendering will follow W3C standards.