"X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE"

392,698

Solution 1

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,

Solution 2

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.

Share:
392,698

Related videos on Youtube

Kuttan Sujith
Author by

Kuttan Sujith

Updated on July 11, 2020

Comments

  • Kuttan Sujith
    Kuttan Sujith almost 4 years
    <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>

  • Kuttan Sujith
    Kuttan Sujith over 11 years
    the order IE=9; IE=8; IE=7; IE=EDGE has some importance, i wish to know that
  • Snekse
    Snekse almost 11 years
    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?
  • PlantTheIdea
    PlantTheIdea almost 11 years
    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.
  • Underverse
    Underverse about 9 years
    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.
  • PlantTheIdea
    PlantTheIdea about 9 years
    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"?
  • pdwalker
    pdwalker almost 9 years
  • Diego
    Diego about 8 years
    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...
  • Raphael Schweikert
    Raphael Schweikert over 7 years
    What’s the difference between the version of the syntax discussed here IE=8; IE=9 vs. what’s in Microsoft’s documentation: 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 <meta> tag?
  • Skyware
    Skyware over 6 years
    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.
  • Andrew
    Andrew over 3 years
    IE=Edge avesome option. Now even my WindowsXP program ActiveX finally shows IE11 , not IE8 css style sheets. Thanks a lot !