强制IE9效仿IE8。可能? [英] Force IE9 to emulate IE8. Possible?

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

问题描述

这是可能的呢?
我尝试添加该页面,但它并没有改变任何事情。

 < META HTTP-EQUIV =X-UA-Compatible的内容=IE = 8>

更新 - 我试图做到这一点,因为我们的网站有一些IE9特定的CSS问题,这些问题将不会出现在IE8。

感谢


解决方案

  

您可以使用文档兼容性
  模式要做到这一点,这是你
  是尝试。但是,需要注意的一点
  是:它必须出现在网页的
  头(HEAD部分)之前的所有
  其他元素,除了标题
  元素和其他meta元素霍普
  这是问题..此外,
  X-UA-Compatible标头不区分
  敏感参见:
   http://msdn.microsoft.com /en-us/library/cc288325%28v=vs.85%29.aspx#SetMode


编辑:万一有事杀MSDN链接,下面是内容:


  

指定文档兼容模式


  
  

您可以使用文档模式来控制的方式的Internet Explorer
  除$ P $点,并显示您的网页。要指定一个特定的文档
  模式您的网页,使用meta元素包括
  在网页X-UA-Compatible标头,如下面所示
  例子。

 < HTML和GT;
< HEAD>
  <! - 启用IE9标准模式 - >
  < META HTTP-EQUIV =X-UA-Compatible的内容=IE = 9>
  <标题>我的网页< /标题>
< /头>
<身体GT;
  < P>内容去此处< / P>
< /身体GT;
< / HTML>

如果您在Internet浏览此网页浏览器9,它会显示
  在IE9模式。


  
  

以下示例指定EmulateIE7模式。

 < HTML和GT;
< HEAD>
  <! - 模仿的Internet Explorer 7 - >
  < META HTTP-EQUIV =X-UA-Compatible的内容=IE = EmulateIE7>
  <标题>我的网页< /标题>
< /头>
<身体GT;
  < P>内容去此处< / P>
< /身体GT;
< / HTML>

在这个例子中,X-UA-Compatible标头指示的Internet Explorer
  确定如何时模仿的Internet Explorer 7的行为
  显示该网页。这意味着它们的Internet Explorer将使用
   指令(或缺乏)选择合适的
  文档类型。由于此页面不包含
  指令,例如将显示在IE5(怪癖)模式。


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">

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

Thanks

解决方案

You can use the document compatibility mode to do this, which is what you were trying.. However, thing to note is: It must appear in the Web page's header (the HEAD section) before all other elements, except for the title element and other meta elements Hope that was the issue.. Also, The X-UA-compatible header is not case sensitive Refer: http://msdn.microsoft.com/en-us/library/cc288325%28v=vs.85%29.aspx#SetMode

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

Specifying Document Compatibility Modes

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> 

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

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> 

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天全站免登陆