Definition and usage of labels in HTML5

Source: Internet
Author: User
Tags html tags

HTML 5 <! Doctype> Label

Definitions and usage

<! The doctype> declaration must be in the first line of the HTML5 document, before the

DOCTYPE declaration does not belong to HTML tags; tag; It is an instruction that tells the browser the version of the markup used to write the page.

It is important to specify DOCTYPE in all HTML documents so that the browser can understand the expected document type.

The DOCTYPE in HTML 4.01 needs to refer to DTDs because HTML 4.01 is based on SGML. While HTML 5 is not based on SGML, there is no need to refer to DTDs, but DOCTYPE is needed to regulate the behavior of browsers (let browsers run the way they should). )。

Instance

HTML5 document with the correct document type (DOCTYPE):

<! DOCTYPE html>
 

The difference between HTML 4.01 and HTML 5

There are 3 different document types in HTML 4.01, and only one in HTML 5:

<! DOCTYPE html>

In HTML5, the document type declaration is not very simple.

Tips and Comments:

Note: <! doctype> tag has no end tag!

Hint: <! Doctype> is not sensitive to case.

Property

NONE

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.