DOCTYPES (was Re: Runtime Error)
by Andrew McFarland <aamcf(at)aamcf.co.uk>
|
|
At 21:48 30/01/02 -0800, Brandon Coughlin wrote:
<snip />
>Regarding the doctype. It is "technically" required on HTML documents
>unless you are trying to code the page to be compliant.
DOCTYPES should only be used on pages that are valid (X)HTML. A page with
some MathML embedded in it won't be valid XHTML, so it shouldn't have a
DOCTYPE for example. Theoretically, a validating parser that comes across a
page with a DOCTYPE should stop processing if it comes across a document
with a DOCTYPE and errors.
Some modern browsers also have two modes, compliant and quirks. In
compliant mode they try to stick exactly to the W3 specs. In quirks mode
they behave as the older browsers used to. The change from quirks to sttict
is usually caused by the presence of particular DOCTYPES. This is another
reason for only using DOCTYPES on valid pages, and is why some problems can
be solved by removing DOCTYPES.
<snip />
>Someone also recommended running it through the validator. That was going to
>be my next stop.
<snip />
The validator is an excellent service. Running your pages through the
validator really helps, both in catching errors that cause problems in
current browsers and in catching errors in coding style that may cause you
difficulties in the future. It is worthwhile using the DOCTYPE override
option to validate your pages against XHTML 1.0 Strict so you get a feel
for the changes you need to make to upgrade your coding techniques. The CSS
validator is also invaluable.
Andrew
--
http://aamcf.co.uk/
HWG hwg-techniques mailing list archives,
maintained by Webmasters @ IWA