---
title: "IE8不兼容你的网页 怎么办? - 简单开启兼容模式"
author: "leavingme"
date: "2008-08-29T14:43:50Z"
tags: []
slug: "ie8"
draft: false
lastmod: "2008-08-29T14:43:50Z"
id: 234434
url: "https://leavingme.iteye.com/blog/234434"
---

**自从用了IE8 整个世界都变了形.**  
**呵呵,问题没那么严重,如果你的网站还来不及修改以适合IE8访问的时候,咱们可以通过非常简单的方法,加几行代码就可以让访问的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> 
```

或者你还可以使用IIS admin tool来定义,更为简单.

[![image](http://blogs.msdn.com/blogfiles/chkoenig/WindowsLiveWriter/ConfiguringApacheforIE8Beta2sIE7Compatib_7BEC/image_thumb.png "image")](http://blogs.msdn.com/blogfiles/chkoenig/WindowsLiveWriter/ConfiguringApacheforIE8Beta2sIE7Compatib_7BEC/image_2.png)