Home > Web Front-end > HTML Tutorial > What are strict mode and mixed mode? Introducing two rendering modes in html

What are strict mode and mixed mode? Introducing two rendering modes in html

零下一度
Release: 2017-05-09 14:17:40
Original
2229 people have browsed it

This content is what you need to know after understanding <!DOCTYPE>.

  • Doctype can declare three DTD types, representing strict version, transitional version and HTML document based on framework respectively.

  • When browser vendors started creating standards-compliant browsers, they wanted to ensure backward compatibility. To achieve this, they created two rendering modes: Standards mode and Promiscuous mode

    • In standards mode, the browser renders the Pages are rendered to the highest standards,;

    • In promiscuous mode, pages are displayed in a less backward-compatible manner. Mixed mode typically emulates the behavior of older browsers to prevent older sites from not working.


  • Mode trigger
    The browser selects the DTD to use based on whether the DOCTYPE exists and which DTD is used. The presentation method used.

    • If an XHTML or HTML 4.01 document contains a complete DOCTYPE, it is generally rendered in standards mode.

    • A DOCTYPE containing a transitional DTD and a URI also causes the page to render in standards mode, but having a transitional DTD without a URI causes the page to render in promiscuous mode.

    • DOCTYPE that does not exist or is incorrectly formed will cause HTML and XHTML documents to be rendered in promiscuous mode.

html5 Since there is no DTD, there is no difference between strict mode and loose mode. HTML5 has a relatively loose syntax. When implemented, it has been implemented as much as possible Large implementation of backward compatibility.


During the interview, I was asked about the definition and distinction between the two modes?
Simplify the first part above. Of course, when the question is triggered, answer the second part.

【Related recommendations】

1. Free html online video tutorial

2. html development manual

3. php.cn original html5 video tutorial

The above is the detailed content of What are strict mode and mixed mode? Introducing two rendering modes in html. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template