Re: DTD choice
by Andrew McFarland <aamcf(at)aamcf.co.uk>
|
Date: |
Thu, 14 Feb 2002 21:13:42 +0000 |
To: |
<hwg-style(at)hwg.org> |
In-Reply-To: |
mit |
|
todo: View
Thread,
Original
|
|
At 09:55 14/02/02 -0700, Ann Ezzell wrote:
>Are there recommendations for DTD(s) to use with style sheets? I'm
>discovering that I get different results depending on what DTD I use.
The glib answer is "Use the appropriate one" :-)
I'll elaborate a bit. Unless you are using Framesets, and assuming you have
decided to use either XHTML 1.0 or HTML 4.01, there are three options you
can use:
The strict DTD
The transitional DTD
No DTD
Some browsers render otherwise identical pages differently depending on
DOCTYPE. Therefore, you should use the same DOCTYPE throughout the site to
help with consistency.
If you can do all your coding with the Strict DOCTYPE, use it. Strict
produces the leanest code, and is easiest to maintain. If you need to use a
feature from the transitional DOCTYPE, use it, and make sure you change the
DOCTYPE from strict to transitional.
If the page needs invalid code omit the DOCTYPE altogether - but remember
to omit it from all pages on the site.
Andrew
--
http://aamcf.co.uk/
HWG hwg-style mailing list archives,
maintained by Webmasters @ IWA