Define IE8 Compatibility Mode Using Conditional Expressions

As far as I understand from my research, IE8 is really annoying such things as forcing yourself to IE7 mode for local hosts on the internal network and local IP ranges. I understand from the previous question that you cannot use conditional operators, regardless of whether IE8 renders in IE8 or IE7 mode, it will still use only <!--[if IE 8]>conditional.

Since this question was asked some time ago (during the beta phase of IE8 by the appearance of things), I wonder if this has changed or is there another way to use conditional expressions to determine whether IE8 is in compatibility mode.

Thank!

+3
source share
3 answers

No, you cannot do this using conventions.

The best way to do this is to use the document.documentMode property, as described in the Pekka link. How to determine if IE8 is in compatibility mode?

+4
source

, , .

I created an override CSS file that I import using conditional comments. However, in the case of IE 8 or 9, this redefinition does not look as good, so I turn on the “force IE to last rendering mode” header switch, as shown below.

<!--[if lte IE 7]>
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <link rel="stylesheet" type="text/css" href="/Content/IE7Overrides.csss" />
<![endif]-->

This provides IE7 with decent resiliency, but forces IE8 and IE9 to display it in the latest browser, which correctly displays the CSS-based table.

-1
source

Source: https://habr.com/ru/post/1752262/


All Articles