What is Document Type or DOCTYPE Declaration and its versions

Document Type Statements and (X)HTML Versions

A Document Type Declaration, or DOCTYPE, is an instruction that associates a particular SGML or XML document (for example, a webpage) with a Document Type Definition (DTD) (for example, the formal definition of a particular version of HTML). In the serialized form of the document, it manifests as a short string of markup that conforms to a particular syntax. (X)HTML documents should begin with a declaration. This statement identifies the type of mark-up that is supposedly used in a document. For example,
indicates that we are using the transitional variation of HTML 4.01 that starts with a root element html. In other words, an tag will serve as the ultimate parent of all the content and elements within this document.
A declaration might get a bit more specific and specify the URI (Uniform Resource Identifier) of the DTD being used as shown here:

In the case of an XHTML document, the situation really isnít much different:
However, do note that the root html element here is lowercase, which hints at the case sensitivity found in XHTML.

HTML or XHTML Version

!DOCTYPE Declaration


HTML 4.01 Strict


HTML 4.01 Frameset


HTML 4.01 Transitional


HTML 4.0 Strict


HTML 4.0 Frameset


HTML 4.0 Transitional


HTML 3.2

HTML 2.0

XHTML Basic 1.1


XHTML Basic 1.0






XHTML 1.0 Frameset


XHTML 1.0 Strict


XHTML 1.0 Transitional


While there are many different versions of (X)HTML, the good news is that the rough document structure defined for each is pretty similar; of course, the bad news is that little details will be different from version to version, so you need to be precise with your syntax.

Related Topic HTML XHTML Basic Structure and Elements
Example of (X)HTML 4.01 Document Structure
XML Schema NCName, QName and ID Attribute Values
Latest Hibernate Interview Questions & Answers
Basic HTML Structure for Biginners

nScraps.com © 2011   Privacy Policy  Terms of Service  Feedback