强制IE8 *不*使用兼容性视图 [英] Force IE8 *not* to use Compatibility View

查看:297
本文介绍了强制IE8 *不*使用兼容性视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是将我的网站更新为更新,更符合标准的设计。我以前的设计是这么垃圾,我不得不使用IE = EmulateIE标签强制IE7仿真。

Just updated my site to newer, much more standards compliant design. My previous design was so rubbish that I had to use the IE=EmulateIE tag to force IE7 emulation.

不幸的是,我相信浏览器可能会从以前的访问缓存此设置,导致我的新网站(看起来很棒,没有按下按钮)再次看起来垃圾。

Unfortunately, I believe that browsers may be caching this setting from previous visits, causing my new site (which looks great without the button pressed) to look rubbish again...

我可以使用任何相反的标签,或者一些魔法,我可以使PHP做HTTP头禁用此设置的缓存?

Is there any opposite tag that I could use, or some magic I can make PHP do to the HTTP headers disable caching of this setting?

推荐答案

在没有X-UA兼容的http-equiv头的情况下,兼容模式由!DOCTYPE (或缺少!DOCTYPE ,视情况而定)。对于其中!DOCTYPE 为您提供哪种模式(在各种浏览器中)参见此处的图表:

In the absence of an X-UA-Compatible http-equiv header, the compatibility mode is determined by the !DOCTYPE (or the absence of a !DOCTYPE, as the case may be). For a chart of which !DOCTYPE gives you which mode (in various browsers) see here:

http://hsivonen.iki.fi/doctype/
(您需要向下滚动)

http://hsivonen.iki.fi/doctype/ (You'll need to scroll down toward the bottom of the page.)

您可以通过使用元素来指定X -UA兼容的http-equiv头,像这样:
< meta http-equiv =X-UA-Compatiblecontent =IE = edge>

You can override this behavior by using a meta element to specify an X-UA-Compatible http-equiv header, like so: <meta http-equiv="X-UA-Compatible" content="IE=edge" >

(注意:IE = edge是可用版本最高的 - 目前为IE8,或者可以明确指定IE8。)

(Note: IE=edge goes with the highest available version -- currently IE8 as of this posting -- or one can explicitly specify IE8.)

有关详细信息,请参阅:
http://msdn.microsoft.com/en-us/library/cc288325(VS.85).aspx

For more information, see here: http://msdn.microsoft.com/en-us/library/cc288325(VS.85).aspx

这篇关于强制IE8 *不*使用兼容性视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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