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 HTML validator, what version of HTML you are using. This is important because there are three different flavors of HTML, below are the "doctype" declarations for each of them:
- HTML 4.0 transitional (the most common):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/REC-html4/loose.dtd">
- HTML 4.0 strict (what these tutorials teach):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/REC-html4/strict.dtd">
- HTML 4.0 frameset (used for frames documents):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/REC-html4/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.