Depends exactly what you are coding in, HTML or XHTML. Once you know that then it is a process of choosing which type of doctype, transitional, strict, or frameset.
frameset- This one is obvious, if you are using frames, use this.
transitional- I am not sure if W3 meant this or not, but I usually think of transitional being used if you are transistioning between two languages (i.e. HTML and XHTML). It's less strict but still gets you going in the right direction.
strict- It's just that, strict. Everything has to be exactly according to w3 standards. This is the most standards compliant way of doing things and, as I see it, the only way coding should be done (unless of course you have frames).
Hope that helps. I know http://www.w3schools.com has some info on DTD's too if you need more explanation.
<edit>
I also found some good info by searching this forum for Document Type Declaration. Rememer, always search first!!
</edit>
The XHTML transitinal DTD, is based on the HTML4.0 transitional DTD, this will support most depricated elements in order to compinsate for older browsers.
Of course the best way to be sure you are using your DTD correctly is to validate it using the W3C markup validator
__________________
Moderator:General web building Get out from under them, resist and multiply.
Get out from under precipice and see the sky.
And lets not forget the DTD to the module based XHTML (1.1)
Modularization takes markup and turns it into 'subsets' or abstract modules
For example, core modules would be:
Structural elements, Text containers, Hyperlinking, List oriented elements.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<edit>
And a few side notes:
the DTD will be placed ABOVE your html element <html>.
A DTD is NOT a regular element OR a comment tag,
it's important its not treated like either.
Also note, its important that DOCTYPE is in caps.
</edit>
__________________
Moderator:General web building Get out from under them, resist and multiply.
Get out from under precipice and see the sky.
hey, (adding a question here ) does it matter if you use a DOC TYPE? I have some sites without a DOC TYPE tag. So do you have to have one or is it just..there? lol
and- whats the purpose in them?
Well, the browser will interpret the markup reardless of a Doctype. The Doctype is used to tell the browser what language is used, and where the base Document Type Declaration (W3's DTD file) is located. However, if you don't use valid code, then adding the Doctype is useless, as your browser uses its own DTD to translate the tags.
Originally posted by Saj The Doctype is used to tell the browser what language is used, and where the base Document Type Declaration (W3's DTD file) is located.
This information is called the Document Type Definition
Also, when adhering to a strict XHTML DTD, there are a few important rules, such as including an XML namespace, etc.
An old thing I compiled some time ago as a response to a question on XHTML-L, that might be useful to you when you want to know whether XHTML1.0 Strict or Transitional is the DOCTYPE for you:
<http://liorean.web-graphics.com/xhtm...se-strict.html>