About! DOCTYPE (Specifies the document type definition that the HTML document follows)

Source: Internet
Author: User

Grammar

Html Top-level element availability "Registration//organization// type label// definition language""URL"

Possible values

Top-level elements Specifies the top-level element type declared in the DTD. This corresponds to the declared SGML document type.
Html Default. Html.
Availability of Specifies whether an official public identifier (FPI) is a publicly accessible object or a system resource.
Public Default. Objects that are publicly accessible.
SYSTEM system resources, such as local files or URLs.
Registered Specifies whether the organization is registered by the International Organization for Standardization (ISO).
+ Default. The organization name is registered.
- The organization name is not registered. The Internet Engineering Task Force (IETF) and the World Wide Web Association (WWW) are not registered ISO organizations.
Organization The designation indicates responsibility by! DOCTYPE declares the name of the group or organization that references the creation and maintenance of the DTD, namely Ownderid.
Ietf Ietf.
W3c W3c.
Type Specifies the public text class, which is the object type being referenced.
Dtd Default. Dtd.
Label Specifies the public text description, which is a unique descriptive name for the referenced exposed text. The version number can be attached later.
Html Default. Html.
Defined Specifies the document type definition.
Frameset The frameset document.
Strict Eliminate the representative attributes and elements that all the experts want to phase out because the stylesheet is perfect.
Transitional Contains the entire contents except for the FrameSet element.
Language Specifies the public text language, which is the natural language encoding system used to create the referenced object. The language definition has been written as an ISO 639 language code (uppercase two letters).
En Default. English.
Url Specifies the location of the referenced object.

Comments

This declaration must appear at the beginning of the document and appear before the HTML tag.

! The DOCTYPE element does not need to close the label.

This element in Microsoft? Available in HTML for Internet Explorer 3.0.

You can use this statement to switch to strict standard compatibility mode in Internet Explorer 6 and later versions. To open this switch, please include it at the top of your document ! DOCTYPE declares that a valid label is specified in the declaration, and in some cases, the definition and/or URLis required. The following table lists the switch conditions for the standard compatibility mode.

DOCTYPE URL appears URL does not appear
DOCTYPE not present Off Off
HTML (No version) Off Off
HTML 2.0 Off Off
HTML 3.0 Off Off
HTML 4.0 Open Open
HTML 4.0 Frameset Open Off
HTML 4.0 Transitional Open Off
HTML 4.0 Strict Open Open
Xhtml Open Open
Xml Open Open
Unrecognized DOCTYPE Open Open

NoteIn standard compatibility mode, it is not guaranteed to be compatible with other versions of Internet Explorer. When standard compatibility mode is turned on, the rendering behavior of the document may be different from the future version of Internet Explorer. This mode should not be used if the content is inherently fixed (such as burning on a CD).

Example

The following example shows how to use it ! The DOCTYPE declares a DTD that specifies the document compliance and switches Internet Explorer 6 and later to standard compatibility mode.

The declaration in the following example specifies that the HTML 4.0 DTD be followed. The second type of declaration specifies "Strict". The first declaration is not specified. Both of these statements will switch Internet Explorer 6 and later to standard compatibility mode.

<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.0//en" ><! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 strict//en" >

The declarations in the example below specify that the "transitional" HTML 4.0 DTD be followed. The second declaration specifies the URL of the DTD. The first declaration is not specified. The second statement will switch Internet Explorer 6 and later to standard compatibility mode. The first kind of declaration does not.

<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 transitional//en" ><! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" >

About! DOCTYPE (Specifies the document type definition that the HTML document follows)

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.