Sorry, your browser doesn't support Java. You cannot see this section of the page which is made with Java.

Things this site will teach you...

  • HTML
  • DHTML
  • XHTML
  • XML
  • CSS
  • DOM
  • JAVASCRIPT
  • SSI
  • PLUG-INS


DHF

Lesson One Chapter One - [The Basic Layout]

The <!DOCTYPE> tag

The <!DOCTYPE> tag is the first thing in every single HTML and XHTML document and contains alot of information about the page it's on.

A long time ago there was something dreamed up called HTML 1.0 which was the language used to make simple webpages at the time. Then came 2.0 which included better styling features and a few more tags. HTML 3.0 came next and was never widely used on the web before it was replaced by the type used on most webpages nowadays. HTML 4.0 and 4.01. The DOCTYPE tag show your computer which type of HTML your page is written in so the computer can de-code it correctly.

The !Doctype tag is quite complicated and doesn't need to be explained in depth as it is more than likely you will only use one !doctype tag ever. Most HTML nowadays is written in version 4.01 which doctypetag is shown below and which you should use if ever in doubt.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

Here is acomplete list of the different versions of HTML. Notice how for each version there are three tags. One for 'Transitional' which is the one you will use, one for 'Strict', which you don't need to worry about and the third is 'Frameset' which you put on frameset pages (See the frames lesson for more details).

2.0
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
3.2
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
4.0 Transitional
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
4.0 Frameset
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">
4.0 Strict
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
4.01 Transitional
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4.01 Frameset
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
4.01 Strict
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">

There are also <!DOCTYPE> tags for XHTML 1.0 (see the XHTML lesson for details) which I have included here as they will become very common in about two years.

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

That is all you really need to know about the <!DOCTYPE> tag. It has to be at the very beggining of every HTML and XHTML document and you can change it to suite the type of HTML you are using. HTML 4.01 Transitional is the most common type of HTML so you should use that <!DOCTYPE> tag if you are in doubt.

The next section is about what goes in the <head> part of HTML and what goes between the <title> tags. Click 'Next' to find out more...


[Previous] [Home] [Contents] [Next]
Hosted by www.Geocities.ws

1