Quick tip: Doctype

July 6th, 2007 · 11:26 am @   -  4 Comments

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">

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • DZone
  • Reddit
  • StumbleUpon
  • Twitter

4 Comments → “Quick tip: Doctype”

  1. [...] semantic markup which validates and works in the modern browsers. Make sure you have a full, valid doctype and you should be able to create any design which works in Opera, Safari, Firefox and even IE7 with [...]


  2. Mike Stevens

    3 years ago

    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

    3 years ago

    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.


  4. Belle Chan

    3 years ago

    I had tried so many times already. How come my drop down menu dun fall below the button? PLease assist. Thanks.


Leave a Reply