!DOCTYPE

Specifies the Document Type Definition (DTD) to which the document conforms.

TopElement

Specifies the top-level element type declared in the DTD. This corresponds to the Standard Generalized Markup Language (SGML) document type being declared.

HTML Default. HTML.

 

Availability

Specifies whether the formal public identifier (FPI) is a publicly accessible object or a system resource.

PUBLICDefault. Publicly accessible object.
SYSTEM System resource, such as a local file or URL.

 

Registration

Specifies whether the organization is registered by the International Organization for Standardization (ISO).

+Default. Organization name is registered.
- Organization name is not registered. The Internet Engineering Task Force (IETF) and World Wide Web Consortium (W3C) are not registered ISO organizations.

 

Organization

Specifies a unique label indicating the name of the entity or organization responsible for the creation and maintenance of the DTD being referenced by the !DOCTYPE declaration—the OwnerID.

IETFIETF.
W3CW3C.

 

Type

Specifies the public text class, the type of object being referenced.

DTD Default. DTD.

 

Label

Specifies the public text description, a unique descriptive name for the public text being referenced. Can be appended with the version number of the public text.

HTML Default. HTML.

 

Definition

Specifies the document type definition.

Frameset frameSet documents.
Strict Excludes the presentation attributes and elements that the W3C expects to phase out as support for style sheets matures.
Transitional Contains everything except frameSet elements.

 

Language

Specifies the public text language, the natural language encoding system used in the creation of the referenced object. It is written as an ISO 639 language code (uppercase, two letters).

ENDefault. English language.

 

URL

Specifies the location of the referenced object.

This declaration must occur at the beginning of the document, before the html tag.

The !DOCTYPE element does not require a closing tag.

Windows Internet Explorer 8 and later. The !DOCTYPE declaration helps determine the document compatibility mode of a Web page. The document compatibility mode of a Web page determines the level of conformance to industry standards, such as the Cascading Style Sheets, Level 2.1 (CSS2.1) and others. To enable the highest level of standards compliance, verify that your Web pages are rendered using the latest document compatibility mode available. For more information, see Defining Document Compatibility.

You can use this declaration to switch Microsoft Internet Explorer 6 and later into strict standards-compliant mode. You turn the switch on by including the !DOCTYPE declaration at the top of your document, specifying a valid !DOCTYPE in the declaration, and in some cases, specifying the Definition and/or URL. The following table shows when standards-compliance is on or off.

DOCTYPEURL PresentURL Not Present
No DOCTYPE presentoffoff
HTML (no version)offoff
HTML 2.0offoff
HTML 3.0offoff
HTML 4.0onon
HTML 4.0 Frameset onoff
HTML 4.0 Transitional onoff
HTML 4.0 Strict onon
XHTMLonon
XMLonon
Unrecognized DOCTYPEonon

 

Note   In standards-compliant mode, compatibility with other versions of Windows Internet Explorer is not guaranteed. When standards-compliant mode is switched on, the rendering behavior of documents may be different in later versions of Internet Explorer. You should not use this mode for content that is fixed in nature, such as content that is burned on a CD.

The following examples show how to use the !DOCTYPE declaration to specify the DTD a document conforms to, and to switch Internet Explorer 6 and later to standards-compliant mode.

Both of the declarations in the following example specify conformance to the HTML 4.0 DTD. The second declaration specifies "Strict" conformance to this DTD. The first declaration does not. Both declarations switch Internet Explorer 6 and later to standards-compliant mode.


<!DOCTYPE html public "-//W3C//DTD HTML 4.0//en">
<!DOCTYPE html public "-//W3C//DTD HTML 4.0 Strict//en">

Both of the declarations in this example specify conformance to the "Transitional" HTML 4.0 DTD. The second declaration specifies the URL of the DTD. The first declaration does not. The second declaration switches Internet Explorer 6 and later to standards-compliant mode. The first 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">

 

 

Show:
© 2014 Microsoft. All rights reserved.