Webmaster Resources Center

Welcome to the Bravenet Resource Center. Use these resources to help make your web pages more advanced and fun to use.

Articles & Tutorials

Document Types

by Jocelyn Kinnear


Summary :

Not many Webmasters know the importance of proper DOCTYPE Declarations, nor do they even know what they are! So what is this 'DOCTYPE'? We'll take a look at what they are in this article.

Not many Webmasters know the importance of proper DOCTYPE Declarations, nor do they even know what they are! So what is this 'DOCTYPE'? We'll take a look at what they are in this article.

If you have ever worked hard on your website and then noticed that, even though you've used valid HTML, the page is breaking or not conforming properly, the issue might just be that you have used the wrong DOCTYPE or you have forgotten to use one altogether.

A lot of you might use HTML with your website, but do you know what version you are using? Knowing and declaring what version of HTML you are using is very important for validation and also for browser parsing. If a browser doesn't know what it is supposed to be parsing (or reading), how will it display the page properly?

Enough, already! How do we use a DOCTYPE? Well, we'll start off by showing you an example for a webpage that is using HTML 4.01:

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

You will see the above tag referred to as a Doctype, DTD tag, or just a Document type tag. The DOCTYPE above declares that the webpage is using HTML 4.01 Strict and it links to a page which explains a little about the specific document type.

We have created a list of Document types that you can use and have put the list into the "Quick Reference Sheets" section of our Resource Center.

If you aren't sure what Document type to use or what HTML version your website is using, you should read up on HTML, choose a Document type and conform your website so that it is valid! The W3 currently recommends XHTML 1.0 as the new standard for HTML. Alternatively, the doctype listed in this article is a good document type to start with!