& Lt ;! DOCTYPE & gt; what is the tag and doctype is

Source: Internet
Author: User

<! DOCTYPE> what is the tag and doctype is
The DOCTYPE tag is the type declaration (document type declaration) of the html document. It is used to tell the browser who declares my mother, what Type of Document Definition is used (Document Type Definition, DTD, which is a general description of the Document, what structure, what valid labels are there, what attributes are supported, and what events are there) to parse the document. Html documents are written by you, while browsers are responsible for rendering. If you can reach a consensus with all the browsers, she can understand you without saying anything. If you know her, it's okay if you don't declare it, just as you don't need to declare it to your dad when you go home, you are Chen 'er egg. However, different browsers render pages in different ways. If the same html document is handed over to different browsers for rendering in their own way, the results will be inconsistent. There are many reasons for this problem, including the original "browser war" (In order to grab users, seize the market, and desperately add new features and new features to their browsers ), there is contempt for W3C standards, and there is a delay in W3C standards. For web developers, this is actually a right. Pass <! DOCTYPE> Labels allow you to use the browser to parse your code (called the standard mode) according to the W3C standard ). If you do not write, the browser will parse and render the page in its own way (called the weird mode ). For browsers, this is a solution to solve compatibility issues. It aims to better support W3C standards while, it can also render web pages that are designed for earlier versions of browsers and do not strictly comply with W3C standards.

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.