& Lt ;! What is DOCTYPE html & gt;, what is its role, and doctypehtml?

Source: Internet
Author: User

<! What is DOCTYPE html>, what is its role, and doctypehtml?

There is always such a sentence in the header of an HTML document <! DOCTYPE html> many times we ignore its existence. It is actually a declaration that tells the browser which HTML version is used to interpret the HTML document.

Although we do not give this statement, the browser will render the HTML document, but the bug caused by the HTML version may be here.

For common doctype types, see w3school.

The statement of htm5 is <! DOCTYPE html>, so we can use this declaration for the newly written front-end project. Otherwise, some new standard features, such as the <canvas> label, cannot be used.

It is not advisable to declare doctype. Different browsers have different default specifications for this situation. Therefore, you must declare doctype and add an exclamation point.

Related Article

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.