At 12/17/2006 01:17 PM, Thierry Koblentz wrote:
David Dorward wrote:
> On Sat, Dec 16, 2006 at 09:48:58PM -0800, Paul Novitski wrote:

>> I believe the reason it's an ie-only hack is that standards-compliant
>> browers won't apply the selector .ie-only.foo to any element because
>> no element has both classes ie-only and foo

> <div class="foo ie-only">
>   This element has both classes
> </div>

That's the way I saw it at first too, but in fact there would be no
"ie-only" class plugged anywhere in the markup.
It'd only appear in the styles sheet. I think it's a rather smart hack...
BTW, do we know if it works in IE Mac too?


Clever as it is, this hack is mis-named -- it should be:

        .browsers-that-dont-support-multiple-class-selectors.foo {...}

It stops being "ie-only" as soon as Microsoft fixes this particular bug without fixing others. The reason it's a "hack" is that it doesn't actually address the problem directly -- the problem being IE's box model or whatever other IE bug you're working around with this selector. It's highly unlikely that this multiple-class selector hack will ever be used to address the problem of IE not supporting multiple-class selectors, which is the only context in which it could be considered good engineering.

I'm with Rob -- use conditional comments if you don't want your hack to break one or two browser versions from now. It know it seems like tomorrow will never come, but it will, and when it does (as is happening even now with IE7) hacks will fail. If you don't think the web pages you're creating today will still be here in five years, look around.

I am, by the way, the pot criticizing the kettle's soot -- I'm still weaning myself off * html selectors.

Regards,
Paul


*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************

Reply via email to