时间:2023-04-25 07:03:41来源:本站整理作者:点击:
为了兼容IE各个版本,需要在CSS中添加额外的代码,比如以前常用的_width。之所以工作,是因为浏览器会忽略不能解析的样式规则,因此举个例子来说,把_width写在width下面,对于非IE浏览器会解析到width,而对于IE6来说,会用_width覆盖前面的width规则,从而达到针对IE6浏览器的兼容。对于IE其他版本(6~11),也存在同样的兼容性处理方法。
下面是一个速查表:
div {
property:value\0; /* ie 8/9*/
property:value\9\0; /* ie 9*/
*property:value; /* ie 7*/
_property:value; /* ie 6*/
}
IE 6
* html .ie6 {property:value;}
or
.ie6 { _property:value;}
IE 7
* html .ie7 {property:value;}
or
*:first-child html .ie7 {property:value;}
IE 6 and 7
@media screen\9 {
.ie67 {property:value;}}
or
.ie67 { *property:value;}
or
.ie67 { #property:value;}
IE 6, 7 and 8
@media \0screen\,screen\9 {
.ie678 {property:value;}}
IE 8
html>/**/body .ie8 {property:value;}
or
@media \0screen {
.ie8 {property:value;}}
IE 8 Standards Mode Only
.ie8 { property /*\**/: value\9 }
IE 8,9 and 10
@media screen\0 {
.ie8910 {property:value;}}
IE 9 only
@media screen and (min-width:0\0) and (min-resolution: .001dpcm) {
// IE9 CSS
.ie9{property:value;}}
IE 9 and above
@media screen and (min-width:0\0) and (min-resolution: 72dpi) {
// IE9 CSS
.ie9up{property:value;}}
IE 9 and 10
@media screen and (min-width:0\0) {
.ie910{property:value\9;} /* backslash-9 removes ie11 & old Safari 4 */}
IE 10 only
_:-ms-lang(x), .ie10 { property:value\9; }
IE 10 and above
_:-ms-lang(x), .ie10up { property:value; }
or
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
.ie10up{property:value;}}
IE 11 (and above..)
_:-ms-fullscreen, :root .ie11up { property:value; }
,
伊利QQ星奶粉和小小CBA达成战略合作,2023年榛高篮球挑战赛全面开启
父母家暴对孩子的影响,如何处理夫妻感情中的家庭暴力?父母家暴对孩子的影响,如何处理夫妻感情中的家庭暴力?
夫妻吵架总冷战怎么办?怎么和好并且化解夫妻吵架呢?“关公”陆树铭因病去世,网爆大衣哥亲往西安悼念,被赞有情有义林志玲登上11月杂志封面,做妈妈之后成为幸福的代名词《卿卿日常》24节气姑娘结局是什么_《卿卿日常》24节气姑娘离开老三了吗Copyright 2022-2026 feiyundao.com 〖妃孕岛〗 版权所有 陕ICP备2022000637号-4
声明: 本站文章均来自互联网,不代表本站观点 如有异议 请与本站联系 本站为非赢利性网站 不接受任何赞助和广告