ITeye博客

让客户ie8浏览器默认使用ie7兼容模式

xinanadu · 2012-03-28 11:50 · php · JSF · Web前端 · Markdown

让访问的IE8自动调用IE7的渲染模式,这样可以保证最大的兼容性,方法如下:

  1.只需要在页面中加入如下HTTP meta-tag:

 

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

 
  只要IE8一读到这个标签,它就会自动启动IE7兼容模式,保证页面完整展示.

  2.还有一种方法是针对整个网站的,在IIS中加入如下描述符就可以有相同的效果,当然这么做范围更广.

 

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
    <httpProtocol>
      <customHeaders>
        <add name="X-UA-Compatible" value="IE=EmulateIE7">
      </customHeaders>
    </httpProtocol>
</system.webServer>
</configuration>

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。