[thelist] Always use a DOCTYPE

Mark Howells mark at mountain.ch
Tue Feb 26 16:12:01 CST 2002

>> Hacking a page
>> together using tricks such as the omission of a DOCTYPE rule is a good
>> way to build unstable pages cross-browser.
> The one and only purpose of doctype-switching is to
> accommodate the requirement of many web developers that the browser
> render
> pages in the same way that previous browser versions would have rendered
> them.

I think we're getting away from the point that a DOCTYPE of some
description is required, and it's omission prompts a browser to handle
the page in the best way it can using a built-in set of rules. I'd be
very surprised it NN6 and IE6 render a page identically if there's no
DOCTYPE included, just because this sends the relevant browser into
"quirks mode". Can the internal handling of pages with no DOCTYPE be
identical in Netscape, IE, Mozilla and Opera? Sounds unlikely to me.

>     It is almost inconceivable that any major web browser -- or any
> minor
> one, for that reason -- will cease to render html pages altogether
> because
> they fail to include a doctype declaration (which is, of course, invalid
> html).

I can easily see this being the case when browsers get to the stage of
rendering XML, as the rules of XML are totally strict and (as far as I'm
aware) can't be hacked by omitting a preliminary XML declaration. XHTML
is simply the first major step on the road to XML, which is what many
developers are overlooking.

> Also keep in mind that the "quirks" mode can be triggered in most
> browsers _without_ writing non-compliant html.

If you're writing compliant HTML and presenting it with compliant CSS,
why is there a need to use a "quirks mode" to display the page? The only
reason that I can see is to attempt an identical cross-browser layout,
which can't be achieved anyway due to the fact that user preferences
involving Javascript, user style sheets and image settings often kill a
layout anyway.

Mark Howells

More information about the thelist mailing list