Does meta http-equiv="X-UA-Compatible" content="IE=edge" impact on non-IE explorer?
Asked Answered
B

1

12

I want to add <meta http-equiv="X-UA-Compatible" content="IE=edge"> in my html page, so that it can use the highest mode available, if user browse this page in a non-IE browser, for example, firefox or chrome, does this line code impact on firefox or chrome ?

Boutonniere answered 5/11, 2013 at 8:45 Comment(1)
Short answer: it's recognized only by IE (because it just ask to render page using specified IE's renderer version) so no, it doesn't (and it doesn't even apply to IE prior version 8).Mahla
E
17

I want to add in my html page, so that it can use the highest mode available.

This is a good idea. In general IE should use it's best mode anyway, but occasionally (eg due to the user's browser config) it might default to a compatibility mode, which isn't great if your page isn't designed for it. So putting this tag into your page is a good way to mitigate against that.

Does meta http-equiv=“X-UA-Compatible” content=“IE=edge” impact on non-IE explorer?

No it doesn't. The tag is specific to IE, and is ignored by other browsers.

It was designed in a way that could have been used by other browsers, but it never was. I have seen a few older examples where people recommend specifying version numbers for other browsers, but doing so would never have have any effect.

The only option other than IE=whatever that is valid is chrome=1. But even this is only used by IE. It is used by the Chrome Frame plugin, to force a page to use the Chrome rendering engine within IE. But note that Chrome Frame is now deprecated, so you shouldn't be using this any more either.


So in summary: Yes, go ahead and add the meta tag to your code, and don't worry about it affecting other browsers.

Early answered 5/11, 2013 at 9:39 Comment(3)
Thanks for the explanation. But W3C validator says, Bad value X-UA-Compatible for attribute http-equiv on element data. Why does it say this?Bainbrudge
@Bainbrudge - because it's a non-standard attribute. If you use it, you will get a validator error. Unfortunately, it is necessary to do things like this even if they fail strict validation, in order to support all browsers. If it really bugs you, it is possible to set X-UA-Compatible via the http headers instead of the meta tag, but really there's no need to worry about the validator warning in this case.Early
Meta http-equiv is a workaround to send HTTP headers. It is said non standard because its adding an HTML tag for presentation purposes. I.e. no real content, nor content meta description. You could add the header from the backend or the webserver itself for each HTML documents.Betts

© 2022 - 2024 — McMap. All rights reserved.