views:

164

answers:

3

I want to write a cross-browser widget, to integrate both to IE standard and quirks mode pages (FF is easy of course).

Since I want to write the styling only once I would like to condition some styling statemets to execute only in quirks/standard mode.

Is there a way t do so?

As far as I understand, both the _ hack and IE conditional comments only allow me to distinguish between different browsers, not different browser modes. Can anyone help?

Thanks a lot!

A: 

If there is, I don't wanna know...

Such an awful idea to write browser-dependent code/style...

Seb
is there a way to use the exact same styling for all browsers and modes? just as an example the box model had completely changed...
This non-answer makes no sense. If the browsers in quesition really maintained a reasonable level of common behaviour then it might be possible to write CSS independently. However they don't. Its especially mystfying in the case of a widget injecting HTML into a page which may or may not be in Quirksmode. How is else can this situation be handled?
AnthonyWJones
By writing HTML that won't trigger quirks mode! Quirks mode is just a workaround for lousy programming...
Seb
+1  A: 
var isIeQuirksMode = (document.all && document.compatMode !== 'CSS1Compat');
alert('In quirks mode: ' + isIeQuirksMode);
Josh Stodola