IE 8兼容:X-UA-Compatible的解释
来源:互联网 发布:数据库日志截断 编辑:程序博客网 时间:2024/06/05 04:07
来源:http://www.ido321.com/940.html
来自StackOverFlow
问题描述:
1: <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE" />
1、这个到底是什么意思?
2、一些示例使用”,”分离IE的版本,而一些使用”;“,哪个正确?
3、我想知道IE=9; IE=8; IE=7; IE=EDGE顺序的含义。
在文档中使用了<!DOCTYPE>
答复:
对于IE8及以上版本,例如:
1: <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7" />
强制浏览器按照特定的版本标准进行渲染。但不支持IE7及以下版本。如果用分号(;)分隔,对于不同的浏览器版本就有不同的兼容性,例如
1: <meta http-equiv="X-UA-Compatible" content="IE=7; IE=9" />
以上就表明,将IE8和IE7按照IE7标准渲染,但是IE9还是按照IE9的标准渲染。它允许有不同的向后兼容水平。尽管在真实情况中,你只要选择一种版本:
1: <meta http-equiv="X-UA-Compatible" content="IE=8" />
1: <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
对于IE=EDGE
1: <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
这意味着,会强制浏览器按照最新的标准去渲染。就像在Google’s CDN使用最新版本的JQuery一样,这是按照最新版本,但也可能由于没有固定的版本而破坏你的布局。
最后,考虑下面这个
1: <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
添加”chrome=1“将允许站点在使用了谷歌浏览器内嵌框架(Chrome Frame)的客户端渲染,对于没有使用的,则没有任何影响。
For more information, there is plenty to read here, and if you want to learn about ChromeFrame (which I recommend) you canlearn about its implementation here.
PS:X-UA-Compatible是针对 IE8 版本的一个特殊文件头标记,用于为 IE8 指定不同的页面渲染模式,对于ie8之外的浏览器是不识别的。
目前绝大多数网站都用<meta http-equiv=”X-UA-Compatible” content=”IE=EmulateIE7″ >来作为IE8的兼容方法。为了避免制作出的页面在IE8下面出现错误,建议直接将IE8使用IE7进行渲染。也就是直接在页面的header的meta标签中加入如下代码:
<meta http-equiv=”X-UA-Compatible” content=”IE=7″ />
<meta http-equiv=”X-UA-Compatible” content=”IE=EmulateIE7″ >
<meta http-equiv=”X-UA-Compatible” content=”IE=EmulateIE8″ >
但是<meta http-equiv=”X-UA-Compatible” content=”IE=EmulateIE7″ >仍然是首选。
StackOverFlow原链接;http://stackoverflow.com/questions/14611264/x-ua-compatible-content-ie-9-ie-8-ie-7-ie-edge?answertab=active#tab-top
下一篇:你口中所谓的人脉,只是一个幌子!!!
- IE 8兼容:X-UA-Compatible的解释
- IE兼容模式X-UA-Compatible
- X-UA-Compatible兼容
- X-UA-Compatible属性的解释
- 使用X-UA-Compatible来设置IE浏览器兼容模式
- 使用X-UA-Compatible来设置IE兼容模式
- 使用X-UA-Compatible来设置IE浏览器兼容模式
- 使用X-UA-Compatible来设置IE浏览器兼容模式
- 使用X-UA-Compatible来设置IE浏览器兼容模式
- 使用X-UA-Compatible来设置IE浏览器兼容模式
- 使用X-UA-Compatible来设置IE浏览器兼容模式
- 使用X-UA-Compatible来设置IE浏览器兼容模式
- 使用X-UA-Compatible来设置IE浏览器兼容模式
- 使用X-UA-Compatible来设置IE浏览器兼容模式
- 使用X-UA-Compatible来设置IE浏览器兼容模式
- 使用X-UA-Compatible来设置IE浏览器兼容模式
- 使用X-UA-Compatible来设置IE浏览器兼容模式
- 使用X-UA-Compatible来设置IE浏览器兼容模式
- 解决VS系列按ALT+G不能跳转问题
- 算法系列-----矩阵(七)-------------矩阵的除法
- 利用Objective-C运行时hook函数的三种方法
- C++ auto_ptr智能指针的用法
- flexslider 使用方式
- IE 8兼容:X-UA-Compatible的解释
- <cstdlib>头文件
- iReport5.6.0 linechart 制作方法
- HDU 2932 Extraordinarily Tired Students (暴力+取模还是很强大的)
- 【DB.PL/SQL】程序流程控制 —— GOTO语句
- 源码安装nginx,mysql模块(drizzle模块), memcache模块, redis模块
- 安装xe7成功及一点经验
- 临渊羡鱼,退而结网
- 折腾Ubuntu14.04 总结