views:

78

answers:

3

Is there any CSS filter can be applied to detect IE6's standard mode and quirk mode?

The story is that a jQuery script is using $.support.boxModel to handle different rendering mode. But the CSS use the *width hack to define the dimension. But this hack can only filter whether the browser is IE but not the real rendering mode IE is on.

A: 

You can't do it in css, but you can include different stylesheets for different versions of IE using conditional comments.

Jouke van der Maas
A: 

Why would you need that? Usually you write a style sheet for one explicit HTML document or at least one specific site where you know whether that page/site is running in quirks or standards mode.

It's not like a page can unexpectedly change modes :-)

If you really need to support a mixture of pages with different modes you'll need to use two separate style sheets, one for each mode.

RoToRa
It's an unusual case that my app need to live inside different 'container'.
jackysee
A: 

I ended up using js injection

if(!$.support.boxModel) $('body').addClass('nobox');

And then do the styling in CSS.

jackysee