& Lt ;! DOCTYPE & gt; label definition and usage, doctype label

Source: Internet
Author: User

<! DOCTYPE> label definition and usage, doctype label

<! DOCTYPE> the declaration is not an HTML Tag; it indicates the web browser's instructions on which HTML version the page is written.

In HTML 4.01, <! DOCTYPE> declare to reference DTD because HTML 4.01 is based on SGML. The DTD specifies the markup language rules so that the browser can correctly render the content.

HTML5 is not based on SGML, so you do not need to reference DTD.

W3c suggestion: always add to HTML document <! DOCTYPE> declaration so that the browser can know the document type.

SGML is an international standard language that defines the structure and description of electronic documents. SGML is not a document language, but it describes a document language, so it is a metalanguage.

Common DOCTYPE declarations

There are three types in HTML 4.01 <! DOCTYPE> declaration. There is only one type in HTML5:

HTML 5

<! DOCTYPE html>

HTML 4.01 Strict

This DTD contains all HTML elements and attributes, but does not include explicit and obsolete elements (such as font ). Framesets is not allowed ).

<! Doctype html public "-// W3C // dtd html 4.01 // EN" "http://www.w3.org/TR/html4/strict.dtd">

HTML 4.01 Transitional

This DTD contains all HTML elements and attributes, including explicit and obsolete elements (such as font ). Framesets is not allowed ).

<! Doctype html public "-// W3C // dtd html 4.01 Transitional // EN" "http://www.w3.org/TR/html4/loose.dtd">

HTML 4.01 Frameset

This DTD is equivalent to HTML 4.01 Transitional, but allows the content of the framework set.

<! Doctype html public "-// W3C // dtd html 4.01 Frameset // EN" "http://www.w3.org/TR/html4/frameset.dtd">

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.