HTML doctypes

I can never remember these things. This is a list so I (or you) can just cut and paste into pages.

HTML 4 transitional:

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

HTML 4 strict:

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

XHTML transitional:

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

XHTML strict:

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

There’s also a good reference on the W3C site that has an explanation of how to use doctypes and a list of the HTML 4 doctypes you can use.

Posted on 07 Dec 04 by Helen Emerson (last updated on 07 Dec 04).
Filed under Web development