Poprivet said:
I do NOT mean the advice above is unsound:
Actually it's the other way round; IE will display a lot of bad code that
the others won't display, because it was originally intended to be more
tolerant of bad code. IE6 tightened that a little, ie7 more, and supposedly
Vista's IE7 is even more compliant, but who knows?
Who knows? I do, as do many others who build sites on a daily basis.
IE7 is more compliant, but generally still lags behind Opera and the
Gecko-based browsers in terms of standards compliance.
Regardless, it's still a matter of proper testing at the right times
during design stages. Trying to write code that is ultra-complaint to the
w3 specs will drive you nuts, plus there are so many different
interpretations of it that it's another frustration area of its own.
I have been coding to the specs for years: I have found that doing so
is getting easier and easier as the browsers are made more compliant.
Right now IE remains the problem child -- the major cause of frustration
-- but there are standard work-arounds to its defects: typically IE may
need a few different lines of CSS. This is no reason to drive anyone nuts.
As to there being so many different interpretations of the specs: no,
there aren't. The current HTML spec has, for many years, been version
4.01; the current CSS spec has been version 2, though most designers
code to the upcoming, but well-defined, version 2.1. The specs are
quite clear: the most significant problems with the specs result from
features which are defined to depend on the user agent, e.g. the
position of the markers in LI lists.
Actually, the best, and easiest "test" is to put your code through an
analyzer and see how it rates. Unfortunately I cannot find the links to the
ones I last used or I'd post them.
The prime analyzer (after the human brain) is an HTML or CSS validator.
Make code that passes these tools, and you are WAY ahead. I also use
a code checker, such as I think you are alluding to, but rarely, mainly
just before site deployment. The next step after validation is checking
pages with browsers that are highly standards compliant: if something
is not right at this stage, it is likely not because the code is bad,
but because the thinking behind the code is faulty. The next step after
this is checking pages with the various versions of IE, and as I
mentioned above, there are standard work-arounds for its defects: the
most recent site I built has two different lines of CSS for IE, and one
different line of JavaScript, easily handled using IE's conditional
comments.