ie条件注释来解决ie hack

来源:互联网 发布:samorost mac 编辑:程序博客网 时间:2024/06/07 10:55

           首先提一点,ie10是不支持条件注释的,它的解决方法网上有介绍


          <!--[if IE 6]>可以加载css文件  <![endif]-->


         <!--[if IE 6]>可以加载<style></style>的定义,放在默认的后面  <![endif]-->



1.区别ie6,ie7,ff

#tip { background:blue; /*Firefox背景变蓝色*/ 
*background:black; /*IE7 背景变黑色*/
 _background:orange; /*IE6 背景变橘色*/ }  /*ie 6也可以识别上面的*,但后面的也可以识别,后来居上*/

#tip { background:blue; /*Firefox 背景变蓝色*/ 
*background:green !important; /*IE7 背景变绿色*/  ie7可以识别*和important,,ff可以识别important,却不能识别*
*background:orange; /*IE6 背景变橘色*/ }

0 0