Doctype Declaration List

The doctype or DTD (Document Type Definition) is a strict little element; it's case sensitive so be sure to copy and paste the desired doctype declaration example exactly as is or else it will not be valid.

The doctype must be specified in your document, this tells the client browser or similar software how to interpret the document. If you don't specify the DTD correctly then you'll most probably be putting the browser into quirks mode which in my experience makes your html cry. Seriously though, just use the appropriate doctype.

Doctypes Declaration Examples

Here's a list of doctype declarations for you to use in your html or xhtml documents.

List of XHTML Doctypes

XHTML Strict Doctype

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

XHTML Transitional Doctype

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

XHTML Frameset Doctype

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

XHTML 1.1 Doctype

 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 
   "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

XHTML Basic 1.1 Doctype

 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN"
    "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">

XHTML Basic 1.0 Doctype

 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN"
    "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">

List of Basic HTML Doctypes

These doctypes are geting rarer around these here parts. I don't remember the last time I wrote a page using a non-xhtml doctype but I'm sure they might come in handy on occasion.

HTML 4.01 Strict Doctype

 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">

HTML 4.01 Loose Doctype

 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

HTML 4.01 Frameset Doctype

 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
   "http://www.w3.org/TR/html4/frameset.dtd">

HTML 3.2 Doctype

 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

HTML 2.0 Doctype

 
<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">

Well, now that you have a valid doctype declaration in place go validate the document using the w3c validation tool and you'll be ready to go.