Html_ Strict mode and promiscuous mode

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.