How to disable compatibility view mode for site in IE8

Quite often, users accidentally enable the IE8’s so called compatibility view mode that forces IE8 to operate almost identically to IE7 (e. g. in this mode, IE8 does not support display: table) — thanks Microsoft for a “good” placement of the corresponding button .

To prevent users from switching to the compatibility view mode when viewing your HTML page in IE8 and newer, use the X-UA-Compatible meta element with the IE=edge value:

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

Unlike the IE=8 value or any other value with a specific numeric version number specified, the IE=edge value forces IE to use the most modern operation mode regardless of the current browser version. So, for example, IE9 won’t be forced to operate in IE8 mode which will get outdated once IE9 is released.

Instead of the meta element, the server response HTTP-header of the same name may be used. Note that unlike standard meta elements and HTTP headers, the X-UA-Compatible meta element takes precedence over the HTTP header, so the meta element overrides the value defined by the header.