On Nov 14, 2006, at 3:03 PM, Klaus Hartl wrote:

> Better not use it! Why?
>
>
> The short answer: Just don't do it.
>
>
> The longer answer:
>
> You are targeting browsers that still get developed further with that
> hack, e.g. IE 7. IE 6 and below do not support advanced CSS2 selectors
> like the child selector in use here.
>
> So for IE 6 you will get away with that hack, but IE 7 will understand
> it and apply the properties declared in that rule. As IE 7 is still  
> far
> from being CSS2 complete and far behind all the other modern browsers,
> and as its rendering engine behaves pretty much like IE 6 that is
> probably not want you want. And then it's getting messy, because you
> probably start to hack something else for IE 7.
>
> If you need to target IE 6 solely, which can be considered as a dead
> browser, you could use the Star Selector hack:
>
> * html .header_b {
>      display: block;
> }
>
> I still recommend using Conditional Comments to keep your main style
> sheet clean. Once you drop support for IE 6 you can simply throw away
> the extra style sheet without having to clean up the main style sheet.
>
>
> The long answer: http://tantek.com/log/2005/11.html
>
>
> -- Klaus


Thanks, Klaus! Yeah, I was going to mention that "* html " hack, but  
I try to avoid it because it seems more "hackish" to me than the  
child selector. Still I do realize that that's a totally personal,  
emotional preference on my part.

The child selector can get you into trouble if IE7 hasn't also fixed  
the bug that you're trying to avoid by using it, which is why browser  
checking in IE7 is important. But I don't think there is anything  
inherently wrong with using the child selector to target browsers if  
you are careful doing so.

That being said, we are in complete agreement that the superior  
solution is to use conditional comments.
Quirksmode is also a good resource for this:
http://www.quirksmode.org/css/condcom.html for more

Klaus, I always greatly appreciate your input on this list. Thanks  
for offering smart, thoughtful help.

Cheers,
Karl
___________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to