设置IE兼容模式
2013-04-27 12:07
225 查看
一.指定文件兼容性模式
要为你的网页指定文件模式,需要在你的网页中使用meta元素放入x-ua-compatible http-equiv 标头。
1. 强制ie8使用ie8模式来解析,而且那个兼容性视图按钮也被去掉了
<meta http-equiv="x-ua-compatible" content="ie=8"/>
2. google chrome frame也可以让ie用上chrome的引擎:
<meta http-equiv="x-ua-compatible" content="chrome=1" />
3.强制ie8使用ie7模式来解析
<meta http-equiv="x-ua-compatible" content="ie=emulateie7"><!-- ie7 mode --> 或者
<meta http-equiv="x-ua-compatible" content="ie=7"><!-- ie7 mode -->
4.强制ie8使用ie6或ie5模式来解析
<meta http-equiv="x-ua-compatible" content="ie=6"><!-- ie6 mode -->
<meta http-equiv="x-ua-compatible" content="ie=5"><!-- ie5 mode -->
5.如果一个特定版本的ie支持所要求的兼容性模式多于一种,如:
<meta http-equiv="x-ua-compatible" content="ie=5; ie=8" />
二.设定网站服务器以指定预设兼容性模式
网站管理员可籍着为网站定义一个自订标头来为他们的网站预设一个特定的文件兼容性模式。这个特定的方法取决于你的网站服务器。举例来说,下列的 web.config文件使microsoft internet information services (iis)能定义一个自订标头以自动使用ie7 mode来编译所有网页。
< ?xml version="1.0" encoding="utf-8"?>
< configuration>
< system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<httpProtocol>
<customHeaders>
<clear/>
<add name="x-ua-compatible" value="ie=emulateie7" />
</customHeaders>
</httpProtocol>
</system.webServer></configuration>
若你已于网站服务器指定了一个预设的文件兼容性模式,你可以在个别页面上指定不同的文件兼容性模式来盖过它。在网页中指定的模式优先权高于服务器中所指定的模式。
要为你的网页指定文件模式,需要在你的网页中使用meta元素放入x-ua-compatible http-equiv 标头。
1. 强制ie8使用ie8模式来解析,而且那个兼容性视图按钮也被去掉了
<meta http-equiv="x-ua-compatible" content="ie=8"/>
2. google chrome frame也可以让ie用上chrome的引擎:
<meta http-equiv="x-ua-compatible" content="chrome=1" />
3.强制ie8使用ie7模式来解析
<meta http-equiv="x-ua-compatible" content="ie=emulateie7"><!-- ie7 mode --> 或者
<meta http-equiv="x-ua-compatible" content="ie=7"><!-- ie7 mode -->
4.强制ie8使用ie6或ie5模式来解析
<meta http-equiv="x-ua-compatible" content="ie=6"><!-- ie6 mode -->
<meta http-equiv="x-ua-compatible" content="ie=5"><!-- ie5 mode -->
5.如果一个特定版本的ie支持所要求的兼容性模式多于一种,如:
<meta http-equiv="x-ua-compatible" content="ie=5; ie=8" />
二.设定网站服务器以指定预设兼容性模式
网站管理员可籍着为网站定义一个自订标头来为他们的网站预设一个特定的文件兼容性模式。这个特定的方法取决于你的网站服务器。举例来说,下列的 web.config文件使microsoft internet information services (iis)能定义一个自订标头以自动使用ie7 mode来编译所有网页。
< ?xml version="1.0" encoding="utf-8"?>
< configuration>
< system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<httpProtocol>
<customHeaders>
<clear/>
<add name="x-ua-compatible" value="ie=emulateie7" />
</customHeaders>
</httpProtocol>
</system.webServer></configuration>
若你已于网站服务器指定了一个预设的文件兼容性模式,你可以在个别页面上指定不同的文件兼容性模式来盖过它。在网页中指定的模式优先权高于服务器中所指定的模式。
相关文章推荐
- 使用X-UA-Compatible来设置IE兼容模式
- 开发收获(5)IE兼容模式及客户端兼容模式、服务器端兼容模式设置
- IIS PHP Thinkphp 重定向 rewrite 设置默认header meta IE 兼容模式
- 强制将IE,Chrome设置为指定兼容模式来解析
- 来设置IE兼容模式
- IE标准模式与兼容模式设置
- IE-->使用X-UA-Compatible来设置IE浏览器兼容模式
- 设置IE的兼容模式
- 设置IE兼容模式
- 强制将IE,Chrome设置为指定兼容模式来解析
- 强制将IE,Chrome设置为指定兼容模式来解析(转)
- 设置IE10用兼容模式打开站点
- 设置IE兼容模式的几种方法
- 设置IE10用兼容模式打开站点
- 设置IE兼容模式
- 强制将IE,Chrome设置为指定兼容模式来解析
- html 设置IE兼容模式
- 让你的网站支持IE 8:使用X-UA-Compatible来设置IE8兼容模式
- 设置IE兼容模式
- 设置IE10用兼容模式打开站点