As I work on my website, I am facing the challenge of incorporating different versions of my style sheet based on the browser's document mode
, not the browser mode
.
For instance, if the documentmode = ie8
, I may need to load main_ie8.css
, whereas for documentmode = ie9
, I might need to load main_ie9.css
A significant number of my users utilize IE9 in compatibility mode, which defaults the document mode
to standards equivalent to those of ie7. To ensure the document mode is set to IE9 standards in IE9, I rely on the following meta tag:
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
The issue arises when the browser mode
remains locked at IE compatibility, keeping the user agent as IE7.
Given that server-side methods cannot determine the running document mode
and conditional comments are designed around the browser mode
, how can I effectively load my CSS files based on the document mode
rather than the browser mode
.