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

Mark Howells mark at mountain.ch
Mon Feb 25 07:42:00 CST 2002


>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
>> "http://www.w3.org/TR/html4/loose.dtd">
>
>> As for the moment I have no other solution than to remove the DOCTYPE-tag
>> in the html-file, but I don't like this solution.
>
> try using the doctype without the url - so
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>
> I'm not sure this will work, but this solution has solved 'weirdisms'
> for me.

Removing either the DOCTYPE (or the link to the DOCTYPE) means that the
browser has no set of "rules" to adhere to when rendering the page. This
results in the browser "guessing" what to do with the file it's receiving
and so it should come as no surprise when future browsers render the page as
plain text (not HTML) or nothing at all. It would be the same as someone
trying to read a book in a foreign language without knowing how to "access"
the rules for that language - a "best guess" would be all that can be
achieved.

Some of the "workarounds" currently in circulation are temporary fixes and
can only be used if you forget about the implications for future browsers
(much the same as using

if(version>6){alert("I'm version 6")}

in Javascript will collapse when version 7 comes along.)

The better solution is to find out the reason why a display characteristic
is occurring and then

- ignore it as it's a minor and acceptable rendering bug
- find a solution to the problem, perhaps finding an alternative means of
laying out the page.

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




More information about the thelist mailing list