Finding The Correct DOCTYPE Many HTML editors automatically insert a DOCTYPE when you create a page. However, it isn't always the DOCTYPE you expect - or want. For instance, HomeSite 4.5 automatically inserts this DOCTYPE:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
Which is fine for pages written using HTML 4.0 that include some formatting tags like FONT, B, and I. But you'll need to modify the DOCTYPE whenever your design uses HTML 4.01, XHTML, or you create a frameset. The W3C provides this listing of valid DOCTYPEs. It's pretty comprehensive, but most often you'll choose between just two, so we'll list them here:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
This is the "transitional" definition. You're telling the browser that you want to use HTML 4.01 standards to render the document, but that you may decide to slip in some deprecated tags for formatting instead of using only CSS for presentation. Deprecated tags are those that are marked for deletion in future versions of HTML/XHTML.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
The "frameset" mode also lets you use deprecated tags like FONT and CENTER and it adds the necessary support to help the browser render the frameset correctly. Place your DOCTYPE definition at the very beginning of your Web page - even before the opening HTML tag. Type it very carefully! DOCTYPE definitions are capital-letter sensitive. The cut and paste method is far safer than typing it by hand at the beginning of each page.