强制 IE9 模拟 IE8.可能的? [英] Force IE9 to emulate IE8. Possible?

查看:22
本文介绍了强制 IE9 模拟 IE8.可能的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能吗?我尝试将其添加到页面中,但它没有改变任何事情.

Is this possible at all? I tried adding this to the page but it didn't change a thing.

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

更新 - 我正在尝试这样做,因为我们的网站有一些 IE9 特定的 CSS 问题,这些问题不会出现在 IE8 中.

UPDATE- I'm trying to do this because our site has some IE9 specific CSS issues, which wouldn't appear in IE8.

谢谢

推荐答案

可以使用文档兼容性模式来做到这一点,这就是你正在尝试.. 但是,要注意的事情是:它必须出现在网页的标题(HEAD 部分)在所有之前其他元素,除了标题元素和其他元元素希望这就是问题所在……另外,X-UA 兼容的标头不是大小写敏感参考:http://msdn.microsoft.com/en-us/library/cc288325%28v=vs.85%29.aspx#SetMode

万一发生某些事情杀死 msdn 链接,这里是内容:

in case something happens to kill the msdn link, here is the content:

指定文档兼容模式

您可以使用文档模式来控制 Internet Explorer解释并显示您的网页.指定特定文档网页模式,使用 meta 元素包含一个网页中的X-UA-Compatible header,如下图示例.

You can use document modes to control the way Internet Explorer interprets and displays your webpage. To specify a specific document mode for your webpage, use the meta element to include an X-UA-Compatible header in your webpage, as shown in the following example.

<html>
<head>
  <!-- Enable IE9 Standards mode -->
  <meta http-equiv="X-UA-Compatible" content="IE=9" >
  <title>My webpage</title>
</head>
<body>
  <p>Content goes here.</p>
</body>
</html> 

如果您在 Internet Explorer 9 中查看此网页,它将显示在 IE9 模式下.

If you view this webpage in Internet Explorer 9, it will be displayed in IE9 mode.

以下示例指定 EmulateIE7 模式.

The following example specifies EmulateIE7 mode.

<html>
<head>
  <!-- Mimic Internet Explorer 7 -->
  <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >
  <title>My webpage</title>
</head>
<body>
  <p>Content goes here.</p>
</body>
</html> 

在本例中,X-UA-Compatible 标头指向 Internet Explorer在确定如何操作时模仿 Internet Explorer 7 的行为显示网页.这意味着 Internet Explorer 将使用指令(或缺乏指令)选择适当的文档类型.因为这个页面不包含指令,该示例将在 IE5 (Quirks) 模式下显示.

In this example, the X-UA-Compatible header directs Internet Explorer to mimic the behavior of Internet Explorer 7 when determining how to display the webpage. This means that Internet Explorer will use the directive (or lack thereof) to choose the appropriate document type. Because this page does not contain a directive, the example would be displayed in IE5 (Quirks) mode.

这篇关于强制 IE9 模拟 IE8.可能的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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