8

I have been reading around the subject of using document compatibility meta tag to web pages.

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

I am a little confused which content value is appropriate/the consensus to use for a xhtml transitional doctype, and then progressively to HTML5 doctype.

We are still supporting IE6, IE7 so would IE=EmulateIE8 be the most suitable.

Can anyone help???

NiseNise
  • 352
  • 2
  • 11
  • 27
  • 1
    See [my answer here](http://stackoverflow.com/questions/6771258/whats-the-difference-if-meta-http-equiv-x-ua-compatible-content-ie-edge/6771584#6771584) for more info on X-UA-Compatible. – L84 Nov 04 '12 at 03:20

3 Answers3

8

What Rob said. Supporting various IEs has nothing to do with compat mode. The X-UA-Compatible header simply makes the IE the site is viewed on to use the latest, most modern layout engine that it has if you set content="IE=edge" IE9 has all IE 8, IE 7, IE 6, and quirks mode supported. IE10 will be supporting IE9 and below as respective engines to render on. So, if you set content="IE=6" it means that particular IE is supposed to use IE 6 engine to render the site - which completely defeats the purpose of using a modern browser.

In HTML5 Boilerplate, we also add chrome=1 so if Chrome Frame is installed, that site will take advantage of that and render the site like it is rendering on Chrome.

Divya Manian
  • 1,849
  • 11
  • 16
4
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">  

is the one you want to use but, so early this morning, I can't recall the reasoning, but it's the one we use everywhere.

With all the various forms of this and combinations of versions of IE, I believe there are something in the hundreds of varieties of coding for IE. Ain't life grand?

Rob
  • 13,342
  • 26
  • 40
  • 60
0

If you are talking about creating new web pages for use on the public Internet, my advice would be to use an HTML5 doctype or other strict doctype and no X-UA-Compatible meta tag. This would be equivalent to one with IE=edge, by the way. This is for web pages compatible with all versions of IE.

You can add the X-UA-Compatible meta tag to an existing page that is only compatible with IEn and lower if you don't have the time or inclination to update it to support the latest version(s) of IE right now. In that case you can use IE=n, where n is the latest version of IE that the page works on. IE versions later than n will go into "IEn mode" and render the page as IEn did. Note that n cannot be less than 7, as that is the first version to support this system. There is no real point to using IE=EmulateIEn on an actual page, that is only useful for when you are sending a blanket header to an entire site via http, instead of altering individual pages. In that case, EmulateIEn would go into "IEn mode" only if a strict doctype was on the page, and into "quirks mode" otherwise.

Gaurav
  • 11,988
  • 2
  • 33
  • 33