234
<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE" />
  1. Actually what is the meaning of this statement ?

  2. Some of the examples use , to separate versions of IE, while some use ;; which is correct?

  3. The order IE=9; IE=8; IE=7; IE=EDGE has some importance, I wish to know that.

Edit: I am using <!DOCTYPE html>

naXa stands with Ukraine
  • 35,493
  • 19
  • 190
  • 259
Kuttan Sujith
  • 7,889
  • 18
  • 64
  • 95

2 Answers2

330

If you support IE, for versions of Internet Explorer 8 and above, this:

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

Forces the browser to render as that particular version's standards. It is not supported for IE7 and below.

If you separate with semi-colon, it sets compatibility levels for different versions. For example:

<meta http-equiv="X-UA-Compatible" content="IE=7; IE=9" />

Renders IE7 and IE8 as IE7, but IE9 as IE9. It allows for different levels of backwards compatibility. In real life, though, you should only chose one of the options:

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

This allows for much easier testing and maintenance. Although generally the more useful version of this is using Emulate:

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

For this:

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

It forces the browser the render at whatever the most recent version's standards are.

For more information, there is plenty to read about on MSDN,

mikemaccana
  • 110,530
  • 99
  • 389
  • 494
PlantTheIdea
  • 16,061
  • 5
  • 35
  • 40
  • 10
    the order IE=9; IE=8; IE=7; IE=EDGE has some importance, i wish to know that – Kuttan Sujith Jan 30 '13 at 18:44
  • I have a bit of a gap in my understanding of this. If my target for testing is IE8, but I don't want to break IE7, what would you set this meta tag to? And do any other browsers use this? – Snekse Jul 15 '13 at 15:17
  • 2
    IE7 will not recognize this, it was implemented first in IE8. The entire reference to IE7 above is if, for example, you were using IE7 as the basis for testing, and wanted all more modern versions of IE to render as it would in IE7 standards. no other browsers use this tag. – PlantTheIdea Jul 15 '13 at 15:35
  • 1
    IE10 renders old web apps well with IE=8 (YMMV), however IE11 emulation of IE8 breaks. This UA: `content="IE=8; IE=11"` gives browser mode IE10 Compat Document mode IE8 standards in IE10, and Document mode edge in IE11. One of the issues with IE10 and IE11 UA assignment is that Microsoft removed [conditional comments](https://msdn.microsoft.com/en-au/library/ie/hh801214.aspx). – Underverse Feb 24 '15 at 02:54
  • Based on that meta tag, IE11 would not emulate IE8, it would assume IE11 (as that was given in the semicolon-separated list). That list would also explain the fallback to IE8 standards because IE10 was unaware of the existence of IE11, just as IE8 could not apply IE9 standards. Have you tried simply using `content="IE=8"`? Or, preferrably, `content="IE=EmulateIE8"`? – PlantTheIdea Feb 24 '15 at 11:44
  • See also: http://stackoverflow.com/questions/6771258/whats-the-difference-if-meta-http-equiv-x-ua-compatible-content-ie-edge-e – pdwalker Jun 17 '15 at 11:06
  • Excelent articule, I was using content="IE=EmulateIE9", so AjaxControlToolkit:ModalPopupExtender does not work with asp:ScriptManager.. I changed it for content="IE=Edge" and it Works great... – Diego Mar 25 '16 at 21:23
  • What’s the difference between the version of the syntax discussed here `IE=8; IE=9` vs. what’s in [Microsoft’s documentation](https://msdn.microsoft.com/en-us/library/jj676915(v=vs.85).aspx): `IE=8, 9`. Do all versions of IE support both? Do both work with ChromeFrame? If so, are both syntaxes ok when we use the HTTP Header instead of the `` tag? – Raphael Schweikert Oct 25 '16 at 11:00
  • The solution for forcing IE to use Edge version despite of IE10 (default), I changed content="IE=IE11" because content="IE=edge" did not work. – Skyware Nov 02 '17 at 12:28
  • IE=Edge avesome option. Now even my WindowsXP program ActiveX finally shows IE11 , not IE8 css style sheets. Thanks a lot ! – Andrew Sep 18 '20 at 08:22
4

In certain cases, it might be necessary to restrict the display of a webpage to a document mode supported by an earlier version of Internet Explorer. You can do this by serving the page with an x-ua-compatible header. For more info, see Specifying legacy document modes.
- https://msdn.microsoft.com/library/cc288325

Thus this tag is used to future proof the webpage, such that the older / compatible engine is used to render it the same way as intended by the creator.

Make sure that you have checked it to work properly with the IE version you specify.

Community
  • 1
  • 1
Ujjwal Singh
  • 4,908
  • 4
  • 37
  • 54