Re: [MACCAWS] Webmonkey article: Web Standards for Hard Times

Simon Willison <[email protected]> Wed, 07 Aug 2002 23:50:58 +0100
Newsgroups gmane.comp.web.vkit
Message-ID <[email protected]>
>Basically CSS syntax hacks...
><snip>
>    ...are pretty much always not needed. There are better, more elegant
>       alternatives for just about every hack I've seen, for example:
>
>         * The NS4 hack /*/*/ .notForNS4 { ... } /* */ can be replaced
>           with *.notForNS4 { ... } or * span { ... }, @import, @media { },
>           media="all", importing via script, conditional comments, etc.
>
>         * The IE5 box-model bug can be mostly corrected by doing:
>
>             #box { width: 500px; }
>             #box { padding: 10px; }
>             <div id="box"><div class="pad">Blah</div></div>
>
>           Instead of the extremely yucky:
>
>             #box {
>                width: 500px;
>                padding: 10px;
>                voice-family: "\"}\"";
>                voice-family: inherit;
>                width: 480px;
>             }
>
>           Oh and the IE5 syntax hack doesn't work in IE6's 
> backwards-compatible
>           mode (which I always force it into by default, the 
> standards-mode is
>           far, far too buggy - <http://tom.me.uk/2002/2/ie6css.html>).

I'm working my way through "Eric Meyer on CSS" at the moment and he does a 
great job of explaining ways of avoiding (or at least minimising) the need 
for CSS hacks and workarounds, so I'm slowly aligning myself with Tom's 
point of view on this one. I still prefer to keep my markup as clean as 
possible but provided it remains logical and structurally sound I'm not 
averse to adding an extra wrapping div here or there.

Cheers,

Simon