DOCTYPE tags in HTML documents

Source: Internet
Author: User

when we write HTML pages, we usually add 〈!DOCTYPE〉 them in the first line. the tags, some editors will automatically help us to add, today talk about this 〈!DOCTYPE〉 the role of the label.

HTML and XHTML

W3Cbefore the organization also issued HTML standards, the development of the Web page when everyone did not add this tag, that time. HTML page development is also confusing, until 1999, HTML 4.01 became the recommended standard, when most people use this version. And probably in 2000, the organization also issued an XML version based on HTML4.01, named XHTML1.0.

The main difference between the two is that XHTML follows the encoding standard of XML, which means that the attributes of the added tag in the XHTML document must be included in "" , and all tags must be closed, and so on more stringent rules. This is also an experienced developer who often reminds new handwriting. html page to be aware of the place. Okay, here's the question:

  • We mentioned earlier that when HTML 4.01 is not used as a recommendation, the HTML document is not 〈!DOCTYPE〉 labeled, and the browser faces an. html document, and if the tag is parsed, there is no explanation for the document.
  • After the introduction of the standard, there are two versions (standard) to write. HTML documents, which standard should the browser use when parsing HTML documents?

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.