Document type declarations
The first thing that should appear on any page that you create should be the document type declaration. This is a small element that tells the browser, or XHTML validator, what version of XHTML you are using. This is important because there are three different flavors of XHTML, below are the "doctype" declarations for each of them:
- XHTML 1.0 transitional (the most common):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- XHTML 1.0 strict (what these tutorials teach):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- XHTML 1.0 frameset (used for frames documents):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
When inserting a doctype declaration, you should be aware of a few things. Firstly, ensure that the type you insert is the correct one for the page, if you are following these tutorials you should use "strict", and secondly you can only have one doctype declaration per document - so make sure you don't put more than one in!
Next we will concentrate on the head section of your code.