Is there a way to condition a CSS styling to execute only on IE quirks mode?
-
10-07-2019 - |
Question
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 statements 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.
Solution
var isIeQuirksMode = (document.all && document.compatMode !== 'CSS1Compat');
alert('In quirks mode: ' + isIeQuirksMode);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow