On Apr 4, 10:48 pm, "Glen Lipka" <[EMAIL PROTECTED]> wrote:
> Feedback desired:
>
<!-- Old Internet Explorer -->> Lately, I have been developing CSS
and HTML for a deep Web 2.0 complex app.
> Usually, I avoid CSS hacks like the plague. But recently, I have had to
> resort to the Holly Hack or the StarHTML Hack. But then it occured to me
> that jQuery provides a better way.
>
> A simple plugin could be written (has this already been written?) that tags
> the BODY (or other node) with a "browser class" resulting in:
> <body class="FF"> or <body class="IE6"> or <body class="Saf"> or whatever.
> Then your CSS would be:
>
> body.ie6 div.troublesome {height: 100%} rather than
> * html div.troublesome etc
>
> This makes your CSS avoid bizarre invalid hacks and use normal "conditional"
> classes that are self-documenting. Everyone knows that body.IE6 means you
> are adjusting for browser differences. And jQuery is much better at
> detection than crazy hacks.
>
There is an easier way that is not jQuery-or-Javascript-dependent,
since mostly we just want to know is the browser IE or not. Use
conditional comments around the BODY tag. See
http://www.puidokas.com/updating-my-css-for-ie7/
. I use :
<!-- Old Internet Explorer -->
<!--[if lt IE 7]>
<body class="IE IElt7">
<![endif]-->
<!-- New Internet Explorer -->
<!--[if gte IE 7]>
<body class="IE">
<![endif]-->
<!-- Any other browser -->
<!--[if !IE]>-->
<body class="notIE" >
<!--<![endif]-->
Danny Wachsstock