Mark Wilson I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :
03/24/2008
Times viewed :
1127
The <!DocType> Tag (XHTML Reference)
Introduction
A document type contains a set of rules for the XHTML file.
A XHTML file can be only valid if you specify the document type to use. The
XHTML file need then to follow the rules, which are defined in the document
type, otherwise it won’t be valid.
These rules defines for example which attributes a specific
tag can use or should contain or whether the attribute is a must or just
optional. All these rules are defined in the document type. You may think that
these rules aren’t really necessary, but these rules are very important,
because without the rules the XHTML language would be useless.
Just imagine if everybody would write down any tags with any
attributes or any values. The result would be that nobody would understand what
somebody has written before. You can mirror this example to the English
grammar, if everybody would create a sentence without using the rules, then
nobody will understand it.
Examples
Here is what a DOCTYPE tag looks like:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Strict//EN"
You have to insert the DOCTYPE tag before the <html> tag starts.
Construction
Name:
Description:
DOCTYPE html PUBLIC
This means that we using the public available DTD.
en
This is the language we are using. Here are some other
codes:
de = German
en = English
en-us = English (USA)
en-uk = English
(UK)
es = Spanish
fr = French
it = Italian
strict
This means that we do not want to use elements or
attributes which aren’t used anymore or which are replaced with CSS.
W3C
This is the publisher of the DTD.
XHTML 1.0
This is the version we want to use.
Furthermore it also includes the URL of the DTD. This is
optional and not really necessary.
Strict can be also replaced with Transitional and FrameSet.
Transitional indicates that you want to use elements and attributes which were
used in old versions of the DTD. FrameSet is used only for files which contains
frames.