[thelist] Always use a DOCTYPE (was: Horizontal scrollbar inIE 6.0)

Mark Howells mark at mountain.ch
Mon Feb 25 12:26:00 CST 2002


>   For HTML documents, removing the URI for the doctype is perfectly valid,
> e.g.:
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

This works for the HTML 4.01 Transitional specification, but not the current
HTML specifications (XHTML 1.0 or XHTML 1.1) or HTML 4.01 Strict.

> In point of fact, few if any browsers actually rely on the dtd specified
> in the doctype in order to render a page. Instead, they rely on their own
> internal rules to render the page, whether in spec-compliance mode or in a
> so-called "quirks" mode.

As I said, this is currently the case. What happens next year, when IE 7 is
released? Surely it's better to make sure that code is correctly formatted
now, so that code doesn't have to be reworked to render correctly in new
browsers, as they're released?

Quote from the MSDN page you linked to:

"You switch on standards-compliant mode by including the !DOCTYPE
declaration at the top of your document, specifying a valid Label in the
declaration, and in some cases, specifying the Definition and/or URL."

"and in some cases" ... which cases would they be? I'd hesitate in coding my
site according to what Microsoft says is the correct way in IE6 -- after
all, many of the problems we face today have been caused by using
browser-specific and proprietary code. I'd rather stick with the W3
Recommendations <http://www.w3.org/TR/2001/WD-xhtml1-20011004/> to
"validate" my code (see Section 3.1.1):

"The system identifier may be changed to reflect local system conventions"
(my interpretation being "but not omitted altogether").

Regards
Mark Howells
<http://www.mark.ac/evl/>




More information about the thelist mailing list