Dave Woods - Freelance Web Design Warwickshire

Quick tip: Doctype

A DOCTYPE (short for “document type declaration”) informs the validator which version of (X)HTML you’re using, and must appear at the very top of every web page. In this quick tip I’ll be going through the valid doctypes that you should use at the start of your document.

HTML 4.01 Strict

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

HTML 4.01 Transitional

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

HTML 4.01 Frameset

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

XHTML 1.0 Strict

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

XHTML 1.0 Transitional

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

XHTML 1.0 Frameset

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

4 comments on “Quick tip: Doctype

  1. Pingback: Dave Woods - HTML, CSS, Web Design » IE6 - CSS Bugs and Fixes Explained

  2. Mike Stevens

    Dave, my problem is that I have a site already built by another programmer. He did not specify a doctype. I am unable to contact him. Is there a way to determine what doctype was used? thanks, Mike

  3. Dave Post author

    Hi Mike,

    You just need to “view source” of the page and the doctype should be the first line of the page. If you’re unsure, feel free to email me a link to the page and I’ll let you know.