使用< meta http-equiv =" X-UA-Compatible"含量=" IE = 8英寸/>网站模式的良好做法? [英] Using <meta http-equiv="X-UA-Compatible" content="IE=8" /> mode in sites good practice?

查看:131
本文介绍了使用< meta http-equiv =" X-UA-Compatible"含量=" IE = 8英寸/>网站模式的良好做法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近发现了将以下内容添加到网站标题中的乐趣:

I've recently discovered the joys of adding the following into the header of sites:

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

网站正常运作,CSS很漂亮,生活也很美好。但我有点担心这种做法有多好?

Websites just work, CSS is beautiful and life is good. But I am slightly concerned about how good a practice this is?

如果安装了IE7,真的很老的计算机怎么样?那个版本的IE7实际上可以访问IE8标准模式吗?

What about an really old computer that has IE7 installed? Can that version of IE7 actually access the IE8 standards mode?

推荐答案

对你问题的最后部分的简短回答是: IE7无法在IE8模式下工作。因此,使用 X-UA-Compatible 标头不会强迫旧版本的IE认为它们是较新的版本。 (如果可行的话,我们都可以开始使用 content =IE-10并且完全担心向后兼容性)

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)

X-UA-Compatible 标志的作用是告诉较新版本的IE重新进入兼容模式以模拟旧版本。因此,你的 content =IE-8标志对IE7或IE8没有影响,但会使IE9重新进入IE8模式。

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.

这意味着IE9将以试图向后兼容的名义有效地抛弃其新功能。

This means that IE9 will effectively throw away its newer features, in the name of trying to be backward compatible.

如果这是什么你想从IE9,然后一定使用 X-UA兼容的标题。如果它不是你想要的,那就不要使用它。

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.

(值得注意的是IE中的向后兼容模式已知不是很擅长与他们试图模仿的版本的真实副本100%兼容,所以不要认为你将获得在IE9中运行的IE8的完美副本 - 它会有它自己的怪癖与任何一个都不同IE8或IE9在正常模式下)

(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)

这篇关于使用&lt; meta http-equiv =&quot; X-UA-Compatible&quot;含量=&QUOT; IE = 8英寸/&GT;网站模式的良好做法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆