What\'s the difference if one web page starts with
Since I can not add a comment to the marked answer I will just post this here.
In addition to the correct answer you can indeed have this validated. Since this meta tag is only directed for IE all you need to do is add a IE conditional.
<!--[if IE]>
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<![endif]-->
Doing this is just like adding any other IE conditional statement and only works for IE and no other browsers will be affected.
if you use your website in the same network as the server IE likes to switch to compability mode despite DOCTYPE.
Adding meta http-equiv="X-UA-Compatible" content="IE=Edge"
disables this unwanted behaviour.
2.1.3.5 X-UA-Compatibility Meta Tag and HTTP Response Header
This functionality will not be implemented in any version of Microsoft Edge.
<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE" />
See https://msdn.microsoft.com/en-us/library/ff955275(v=vs.85).aspx
Yes, I know that I'm late to the party, but I just had some issues and discussions, and in the end my boss had me remove the X-UA-Compatible
tag remove from all documents I've been working on.
If this information is out-of-date or no longer relevant, please correct me.
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
To make this line work as expected, make sure that:
<head>
<html>
elementOtherwise some IE versions simply ignore it.
UPDATE
These two rules are simplified but they are easy to remember and to verify. Despite MSDN docs stating you can put title and other meta tags before this one, I would not recommend to do so.
How make it work with conditional comments.
Interesting article about the order of elements in the head. (blogs.msdn.com, for IE)
REFERENCE
From the MSDN documentation:
The
X-UA-Compatible
[...] must appear in the header of the webpage (the HEAD section) before all other elements except for the title element and other meta elements.
I think this diagram from Microsoft explains all. In order to tell IE how to render the content, !DOCTYPE has to work with X-UA-Compatible meta tag. !DOCTYPE by itself has no affect on changing IE Document Mode.
http://ie.microsoft.com/testdrive/ieblog/2010/Mar/02_HowIE8DeterminesDocumentMode_3.png
Just for completeness, you don't actually have to add it to your HTML (which is unknown http-equiv in HTML5)
Do this and never look back (first example for apache, second for nginx)
Header set X-UA-Compatible "IE=Edge,chrome=1"
add_header X-UA-Compatible "IE=Edge,chrome=1";