IE X-UA-Compatible Meta Tag

The X-UA-Compatible meta tag allows web authors to choose what version of Internet Explorer the page should be rendered as. It is used by Internet Explorer 8 to specify if a page should be rendered as IE 7 (compatibility view) or IE 8 (standards view).

You specify the user agent and version to use in the contents of the tag:

"IE=EmulateIE7"

The options you have for the content are:

  • "IE=5"
  • "IE=EmulateIE7"
  • "IE=7"
  • "IE=EmulateIE8"
  • "IE=8"
  • "IE=EmulateIE9"
  • "IE=9"
  • "IE=edge"

Emulating the version tells the browser to use the DOCTYPE to determine how to render content. pages without a DOCTYPE will be rendered in quirks mode.

If you tell it to use the browser version without emulating (i.e. "IE=7") the browser will render the page in standards mode whether or not there is a DOCTYPE declaration.

"IE=edge" tells Internet Explorer to use the highest mode available to that version of IE. Internet Explorer 8 can support up to IE8 modes, IE9 can support IE9 modes and so on.

X-UA-Compatible Meta Tag Type:

The X-UA-Compatible meta tag is a http-equiv meta tag.

X-UA-Compatible Meta Tag Format:

Emulate IE 7

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

Display as IE 8 with or without a DOCTYPE

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

Quirks Mode (IE 5)

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

X-UA-Compatible Meta Tag Recommended Uses:

Use the X-UA-Compatible meta tag on web pages where you suspect that Internet Explorer 8 will attempt to render the page in an incorrect view. Such as when you have an XHTML document with an XML declaration. The XML declaration at the top of the document will throw the page into compatibility view but the DOCTYPE declaration should force it to be rendered in standards view.

Leave a comment