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

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

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

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
  只要IE8一读到这个标签,它就会自动启动IE7兼容模式,保证页面完整展示.

  还有一种方法是针对整个网站的,在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>

原文地址:https://www.cnblogs.com/sky266/p/1845594.html