HTML Note (i): Docutype

Source: Internet
Author: User

1, the role of Docutype?

Write a page The first thing is to write <! DOCTYPE Html>

  Function: Declares the parsing type (document.compatmode) of the document and avoids the browser's use of weird mode.

  Document.compatMode:BackCompat: Weird mode, the browser uses its own weird mode to parse the rendered page, (default).

  Document.compatmode: css1compat: Standard mode, browser using the standard analysis rendering page.

This property will be recognized and used by the browser, but if your page does not have a DOCTYPE declaration, the Compatmode default is Backcompat. When the browser parses the rendered page in its own way, the different styles are displayed in different browsers, and compatibility issues are likely to occur.

  If you add <! to your page DOCTYPE html> So, then it is equivalent to open the standard mode, then the browser will have to be honest in accordance with the standards to parse the rendering page, so that your page in all browsers display is a look. This is <!. The role of DOCTYPE html>.

2. How to use

<! DOCTYPE html>, there is no compatibility problem, and not case-sensitive!

HTML Note (i): Docutype

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.