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]-->

猜你喜欢

转载自blog.csdn.net/qq_42221334/article/details/80346472