css hack基本概念
针对不同浏览器写不同的css,使其能达到想要的相同显示效果,就是css hack
IE浏览器Hack分类
条件hack
<!--[if IE]> <style> .test{color:red;} </style> <![endif]-->
- 属性hack
.test{ color:#090\9; /*IE8+*/ *color:#f00; /*IE7 and earlier*/ _color:#ff0; /*IE6 and earlier*/ }
- 选择符hack
* html .test{color:#090;}/*IE6 and earlier*/ * +html .test{color:#ff0;}/*IE7*/