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

Tom Gilder <[email protected]> Wed, 7 Aug 2002 23:33:13 +0100
Newsgroups gmane.comp.web.vkit
Message-ID <[email protected]>
On Wednesday, August 7, 2002, 7:58:41 PM, you wrote:
> He has a very good point here. What I'm asking is: Should we be pushing
> workarounds/hacks to work WITH the older browsers, or settle with
> (possibly) less visually appealing & precise layouts which ARE cleanly
> laid out but still remain W3C compliant.

I hate and loath CSS syntax hacks. I've been meaning to jot down in a quick
article why I do so, but I've never got round to it.

Basically CSS syntax hacks...

   ...are ugly as hell, and remembering which hack is which is a nightmare.
   
   ...might possibly break future browsers. Who knows what parsing bugs the
      next PDA browser might have?

   ...sometimes screw up if a browser fixes the parsing bug, but doesn't fix
      other buggy behavior.
     
   ...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 agree with Simon that additions to HTML should be kept to a minimum to solve
browser bugs, but I prefer adding a couple of <div> or <span> elements here and
there if it means avoiding CSS syntax hacks.

</rant>

-- 
Tom Gilder
http://tom.me.uk/