I've recently discovered the joys of adding the following into the header of sites:
<meta http-equiv="X-UA-Compatible" content="IE=8" />
Websites just work, CSS is beautiful and life is good. But I am slightly concerned about how good a practice this is?
What about an really old computer that has IE7 installed? Can that version of IE7 actually access the IE8 standards mode?
The X-UA-Compatible meta tag is a http-equiv meta tag. 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 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 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.
The short answer to the last part of your question is no: IE7 can't be made to work in IE8 mode. So using the X-UA-Compatible
header won't force older versions of IE to think they're a newer version. (if that worked, we could all just start using content="IE-10"
and be done with worrying about backward compatibility forever)
What the X-UA-Compatible
flag does is tell newer versions of IE to fall back into compatibility mode to emulate older versions. So therefore, your content="IE-8"
flag will have no effect on IE7 or IE8, but will make IE9 fall back into IE8 mode.
This means that IE9 will effectively throw away its newer features, in the name of trying to be backward compatible.
If this is what you want from IE9, then by all means use the X-UA-Compatible
header. If it isn't what you want, then don't use it.
(it's worth noting that the backward compatibility modes in IE are known to be not very good at being 100% compatible with real copies of the version they're trying to emulate, so don't think that you'll get a perfect copy of IE8 running in IE9 either -- it'll have it's own quirks that are different to either IE8 or IE9 in normal mode)
Another thing to be aware of is that the tag examples microsoft have provided don't always work. read defining document compatibility, especially the community additions at the bottom of the page.
As far as best practice goes, they are probably not the best long term solution but came in very handy when IE9 was released and sites went down.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With