How to force compatibility mode for all versions of IE?

My project supports IE8 to IE10. We are trying to use standard code and support standard mode for all versions of IE.

We use the following to force IE to open in the last mode:

<meta http-equiv="X-UA-Compatible" content="IE=edge" /> 

But for some cases, we need to force IE to open the site in compatibility mode. For example, when a user opens a site in IE10, he should open in IE10 compatibility mode. When a user opens a site in IE9, it should open in IE9 compatibility, etc. For IE8.

Is it even possible to force compatibility mode to force, or can we only force document mode and not browser compatibility mode?

If possible, is it possible to have a common operator for all versions of IE, and not for the syntax of a specific version of IE, as indicated in post-bound, when it requires IE8 to emulate IE7: Force IE8 Into IE7 compatibility mode

+6
source share
1 answer

Compatibility mode is designed to help users with older products that are not updated. In no case should this help the developer avoid the problems that he might find.

If you absolutely have no choice (for example, a broken dependency such as SharePoint ...) or you want to identify a serious lack of competence, you should not force the user to see your page in compatibility mode.

If you need to support all versions of IE, you must understand how each version works, and be aware of each difference in order to make code that can lead to the same release, regardless of version.

If the idea of โ€‹โ€‹getting a "crappy version" (like IE6 and older) sounds really bad for you, I would advise you to set a threshold to focus on compatibility with some older versions, and not with all of them.


EDIT: But if you really need to force compatibility mode, you can use the "X-UA-Compatible" meta tag. For instance:

 <meta http-equiv="X-UA-Compatible" content="IE=9" /> 
+8
source

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


All Articles