Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which X-UA-Compatible mode should I be using?

Tags:

html

xhtml

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???

like image 874
NiseNise Avatar asked Jul 14 '11 11:07

NiseNise


People also ask

What is http equiv in meta tag?

The http-equiv attribute provides an HTTP header for the information/value of the content attribute. The http-equiv attribute can be used to simulate an HTTP response header.

What is meta type in HTML?

Definition and Usage. The <meta> tag defines metadata about an HTML document. Metadata is data (information) about data. <meta> tags always go inside the <head> element, and are typically used to specify character set, page description, keywords, author of the document, and viewport settings.

Does X UA need compatible?

X-UA-Compatible is a document mode meta tag that 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 whether a page should be rendered as IE 7 (compatibility view) or IE 8 (standards view).

What is IE and edge?

What is IE mode? IE mode on Microsoft Edge makes it easy to use all of the sites your organization needs in a single browser. It uses the integrated Chromium engine for modern sites, and it uses the Trident MSHTML engine from Internet Explorer 11 (IE11) for legacy sites.


2 Answers

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.

like image 86
Divya Manian Avatar answered Oct 03 '22 20:10

Divya Manian


<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?

like image 22
Rob Avatar answered Oct 03 '22 21:10

Rob