解答
一般来说是针对不同的浏览器写不同的CSS,就是 CSS Hack。
IE浏览器Hack一般又分为三种,条件Hack、属性级Hack、选择符Hack(详细参考CSS文档:css文档)。
例如:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | // 1、条件Hack <!--[ if IE]> <style> .test{color:red;} </style> <![endif]--> // 2、属性Hack .test{ color: #090\9; /* For IE8+ */ *color: #f00; /* For IE7 and earlier */ _color: #ff0; /* For IE6 and earlier */ } // 3、选择符Hack * html .test{color: #090;} /* For IE6 and earlier */ * + html .test{color: #ff0;} /* For IE7 */ |
帖子还没人回复快来抢沙发