[thelist] [SOLVED] mac/ie background image problem

Bertilo Wennergren bertilow at gmx.net
Sun Sep 29 05:43:01 CDT 2002


Peter-Paul Koch:

> Personally, I think doctype switching is the worst disaster to web
> developers since the two DOMs of Netscape and Explorer 4.

I think you exaggerate a bit, but you're right that it's a bad thing.

> Doctypes should have no influence at all on how a web page looks and acts.

True. But unfortunately they have, and _so does a lack of a doctype_.

> As long as they do, I don't use doctypes and I advice everyone not to use
> them, either.

You've written about this before, and I find your conclusion and advice
very surprising, and wrong.

There is no escaping doctype switching. The browsers will do it, and
we'll just have to adapt. Your solution is no solution at all. When you
choose not to include a doctype, you're not "switching off doctype
switching". It's still happening.

"No doctype" will put those browsers that do doctype switching into
quirks mode. The same thing will happen for a number of actual doctypes.
Other doctypes will put them into standards mode. Etc. Choosing "no
doctype" is just one of the choices available. The switching is still
going on.

I always choose a doctype that will put the switching browsers into
standards mode. You're choosing a "doctype" (= no doctype) that always
puts them into quirks mode. Those are different choices, but the
switching is still happening.

Intentionally going for one of the choices that turns on quirks mode is
in my opinion a very bad choice. Quirks mode is just for old pages that
are they way they are and need quirks mode to work. New pages should
always be done for standards mode. There is very real possibility that
quirks mode will go away one day (along with doctypes switching) and
then some pages made for quirks mode might stop working.

The only scenario in which choosing no doctype would be the best choice,
is a scenario where browsers would drop standards mode in the future,
staying with quirks mode only. That is very unlikely.

Intentionally choosing quirks mode - like you are - means saying: I want
my pages to depend on the bugs in old browsers. The bugs however will go
away, and your pages might stop working.

> <tip type="browser compatibility" author="ppk">
> Never ever use doctypes. They're far more trouble than they're worth. If you
> don't believe me, code a complex page with a doctype and view it in IE6,
> Mozilla and IE5Mac.
> You see?
> </tip>

We can not see how pages will look in future browsers, since they have
not been made yet. But we can predict that they will be more standards
compliant than current browsers, and that some of them might only use
standards compliant mode.

You want doctype switching to go away? Well, it probably will. But then
what will happen is that quirks mode goes away. Or do you see a
possibility that Mozilla and MSIE will one day drop their standards
compliant mode and only use quirks rendering?

For advanced layouts that are sensitive to the differences between
standards mode and quirks mode, we can only adapt our code to reality
(which includes the upcoming browsers). Hiding the CSS from old browsers
helps a lot, but there is no hiding it from MSIE5 that will always be in
quirks mode. So we just have to write the code so it works in both
standards mode and quirks mode. That can be done. It takes some
knowledge and a few tricks, but it can be done - mostly. When it can't
be done, we'll just have to choose a simpler layout. Dropping the
doctype, or choosing a quirks doctype, is no solution at all. Actually
it means working against standards support in browsers. I'm quite sure
that you want more standards support, not less.

--
Bertilo Wennergren <bertilow at gmx.net> <http://www.bertilow.com>




More information about the thelist mailing list