Importance of HTML DOCTYPE

Source: Internet
Author: User

Definition and usage

<! DOCTYPE> Declaration must be the first line of the HTML document, located before the <! 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.


DOCTYPE

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">

If doctype is not added to html, a bug may occur in different browsers. Therefore, adding doctype to html is crucial.



Reference: http://www.w3school.com.cn/tags/tag_doctype.asp








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.