CSS Hack

IE6,IE7,IE8,Firefox兼容的css hack

补充:
color{
 background-color: #CC00FF;  /*所有浏览器都会显示为紫色*/
 background-color: #FF0000\9; /*IE6、IE7、IE8会显示红色*/
 *background-color: #0066FF;  /*IE6、IE7会变为蓝色*/   
 _background-color: #009933;  /*IE6会变为绿色*/
}
好多css hack,最重要的是简单实用能解决问题就行了
总结:
\9: IE6 IE7 IE8
*: IE6 IE7
_: IE6
*+: IE7
---------------------------------------- 
IE6,IE7,Firefox兼容的css hack
第一种办法:
body
{
    background:red;
    *background:blue !important;   
    *background: green;
}

第一排给Firefox以及其他浏览器看;
第二排给IE7,IE7既能能识别*号,也能识别important;
第三排给IE6也能识别*号;
第二种办法,使用_来区分IE6:

body
{
    background:red;
    *background:blue;   
    _background: green;
}

第一排给Firefox以及其他浏览器看;
第二排给IE7,IE7既能能识别*号;
第三排给IE6能识别下划线;
posted @ 2015-07-20 22:23  小菜鸡12315  阅读(122)  评论(0编辑  收藏  举报