css hack

#test{  

  color:red; /* 所有浏览器都支持 */ 
  color:red !important; /* Firefox、IE7支持 */ 
  _color:red; /* IE6支持 _是IE6专有的hack*/ 
  *color:red; /* IE6、IE7支持 */ 
  *+color:red; /* IE7支持 */ 
  “\9″ IE6/IE7/IE8/IE9/IE10都生效
      “\0″ IE8/IE9/IE10都生效,是IE8/9/10的hack
      “\9\0″ 只对IE9/IE10生效,是IE9/10的hack

仅所有的WIN系统自带IE可识别

<!--[if IE 6]> Only IE 6 <![endif]-->
只有IE6可以识别

<!--[if gt IE 6]> Only IE 6+ <![endif]-->
IE6以上

<!--[if lt IE 6]> Only IE 6- <![endif]-->
IE6以下

<!--[if gte IE 6]> Only IE 6/+ <![endif]-->
IE6以及IE6以上

<!--[if lte IE 6]> Only IE 6/- <![endif]-->
IE7以及IE7以下

 

*html *前缀只对IE6生效

*+html *+前缀只对IE7生效

@media screen\9{...} 只对IE6/7生效

@media \0screen {body { background: red; }}只对IE8有效

@media \0screen\,screen\9{body { background: blue; }}只对IE6/7/8有效

@media screen\0 {body { background: green; }} 只对IE8/9/10有效

@media screen and (min-width:0\0) {body { background: gray; }} 只对IE9/10有效

@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {body { background: orange; }} 只对IE10有效

转载于:https://my.oschina.net/u/3147332/blog/807101

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值