Supported by :   My Law Forms Ltd. - Deed polls and Tenancy Agreements

XHTML Black Magic: W3C DTD

If you wish to become an XHTML wizard you must first master the art of the Document Type Definition (DTD). This simple line of code is almost always forgotten and hardly understood by HTML beginners.

A DTD does exactly what it says: define a type of document. Basically it’s a link to a definition file somewhere on the web, most typically the W3C (the folks who come up with web standard guidelines to begin with), that has a bunch of information about the way you’ve marked your document.

Since we’re working with XHTML we can use one of three different definitions:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"

Depending on what you’re doing you’ll choose one and slap it on the first line of your document. Typically you should use the Strict DTD. It will force you to use really clean markup and Cascading Style Sheets (CSS) for presentation. The Transitional DTD gives you some of the presentational stuff found in HTML 4 and the Frameset DTD is only used when you want to use frames on your website.

Further details can be found at W3C

This entry was posted on Thursday, December 21st, 2006 at 1:22 pm and is filed under HTML help, XHTML tips. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Comments are closed.