CSS 浏览器兼容 hack法

来源:互联网 发布:背单词的软件 编辑:程序博客网 时间:2024/05/22 15:14

hack法:

.box{color:white;background:blue;   /*火狐识别*/background:red \9; /*ie6 7 8  可以识别*/*background:black; /*ie6 7   可以识别*/_background:orange;/*ie6  可以识别*/}
IE6 双倍边距的问题:

.main_left{width:362px;float:left;margin:15px 20px;  /* IE6中,有float 和 margin 时,左右边距会显示双倍边距 */display:inline;  /* 加入这句,兼容IE6双倍边距的问题 */line-height:24px;}
IE6中 1px高度的div
.box{height:1px;width:1000px;background:blue; overflow:hidden;   /* 加入这句,可以兼容IE6,实现1px高的div */}




原创粉丝点击