HTML XHTML The Complete Reference
home » reference » appendix a » html element reference


<!DOCTYPE> (Document Type Definition)


This SGML construct specifies the document type definition corresponding to the document. No attributes or events are associated with this element.

Standard Syntax


<!DOCTYPE "DTD IDENTIFIER">

Examples


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN">

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 TRANSITIONAL//EN">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "xhtml11.dtd">

Compatibility


HTML 2, 3.2, 4, 4.01, XHTML 1.0, 1.1, Basic
Internet Explorer 2, 3, 4, 5, 5.5, 6
Netscape 1, 1.1, 2, 3, 4, 4.5-4.8, 6, 7
Opera 4-7

Notes


The <!DOCTYPE> element should be used as the first line of all HTML documents.

Validation programs might use this construct when determining the correctness of an HTML document.

Modern browsers may determine what rendering mode to use depending on the doctype statement. This is dubbed the doctype switch. An incorrect doctype that does not correspond to appropriate markup usage may result in inaccurate display.

(X)HTML Elements
CSS Properties
Previous: dl Next: dt
< Home | About | Chapters | Examples | Errata | Reference | Site Map >