css 多浏览器不兼容问题

来源:互联网 发布:卖精仿鞋的淘宝店铺 编辑:程序博客网 时间:2024/05/13 14:37

1、解决IE6、IE7、Firefox兼容最简单的CSS Hack写三句代码来控制一个属性,区别Firefox,IE7,IE6: background:orange;*background:green !important;*background:blue;

 这段代码会使在Firefox中,背景呈橙色;IE7中为绿色;IE6中为蓝色。

道理如下,Firefox不能识别*,所以后面两句都不执行,直接执行第一句;

IE7三个都能识别,但是由于有第二句important的作用,所以就执行了第二句代码;

IE6不能识别!imprtant,按照最新原则,那就理所当然的执行了最后一句。


2、只有google能识别的css  .history-date ul li .h3 只有google浏览器能读

 @media screen and (-webkit-min-device-pixel-ratio:0) {           .history-date ul li .h3 {                color: #999;                       padding-right: 3px;                padding-left: 0px;                padding-top: 10px;                background-color: #fff;                border-radius: 5px;            }   } 

3、css里面

用<div style="text-align:left"></div> 和在里面使用float:left 效果是不一样的

0 0
原创粉丝点击