IE8 兼容

boy 火巨


下面再写个背景
background: #ffd700\9;      兼容ie9以下

ie8背景图片平铺
filter :  progid : DXImageTransform . Microsoft . AlphaImageLoader (  src = '../images/bg.png' ,  sizingMethod = 'scale' );   - ms - filter :  progid : DXImageTransform . Microsoft . AlphaImageLoader (  src = '../images/bg.png' ,  sizingMethod = 'scale' );


ie8区别ie6~8的方法是:
width:10px;//chrome 
width:10px\9;//ie8+ 
*width:10px;//ie7 
_width:10px;//ie6 
ie8区别ie8以下和ie9+的方法是 
body{width:10px\9;}//ie8 
:root body{width:10px\9;}//ie9+ 


#menu {  line-height 23px ; } /* firefox 浏览器实行这句定义 */ 
#menu {  line-height 26px \ 9 ; } /*ie6,ie7,ie8 这句定义主要尖对IE8来hack*/ 
#menu { * line-height 23px ; } /*ie6,ie7 这句定义主要尖对IE7来hack*/ 
#menu {  _line-height 23px ; } /*ie6 浏览器优先实行这句定义*/
#menu { line-height:23pxline-height26px\9; *line-height23px_line-height:23px; }

* html #menu {  line-height 23px ; }  /* IE6 浏览器实行这句定义 */ 
*+html #menu {  line-height 23px ; } /* IE7 浏览器实行这句定义*/



ie8浏览器打开网页加载特定的css文件
加上条件注释语句
<!--[if IE 8]>
<link rel="".........................>
<![endif]-->
ie条件注释语句还可以加上以下限制
lte:就是Less than or equal to的简写,也就是小于或等于的意思。
lt :就是Less than的简写,也就是小于的意思。
gte:就是Greater than or equal to的简写,也就是大于或等于的意思。
gt :就是Greater than的简写,也就是大于的意思。
! :就是不等于的意思,跟javascript里的不等于判断符相同
比如
<!--[if lte IE 8]>
<link rel="".........................>
<![endif]-->就表示小于或等于ie8版本就调用link里面的样式
 
  
<!--[if !IE]><!--> 除IE外都可识别 <!--<![endif]-->
<!--[if IE]> 所有的IE可识别 <![endif]-->
<!--[if IE 6]> 仅IE6可识别 <![endif]-->
<!--[if lt IE 6]> IE6以下版本可识别 <![endif]-->
 
  
<!--[if lte IE 6]> IE6以及IE6以下版本可识别 <![endif]-->

<!--[if gte IE 6]> IE6以及IE6以上版本可识别 <![endif]-->
<!--[if IE 7]> 仅IE7可识别 <![endif]-->
<!--[if lt IE 7]> IE7以下版本可识别 <![endif]-->
<!--[if gte IE 7]> IE7以及IE7以上版本可识别 <![endif]-->
<!--[if IE 8]> 仅IE8可识别 <![endif]-->
<!--[if IE 9]> 仅IE9可识别 <![endif]-->

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值