码迷,mamicode.com
首页 > Web开发 > 详细

CSS 兼容 总结

时间:2014-12-30 11:40:04      阅读:170      评论:0      收藏:0      [点我收藏+]

标签:

1> margin加倍的问题

设置为floatdivie下设置的margin会加倍。这是一个ie6都存在的bug

解决方案是在这个div里面加上display:inline;

例如:

<div id=”IamFloat></div>

相应的css

#IamFloat

{

float:left;

margin:5px;

display:inline;

}

2> 给Flash设置透明属性可使层显示在Flash之上

<param name="wmode" value="transparent" />        

<!-- 解决IE上的问题 //>

<embed wmode="transparent" …… >                    

<-- 解决FireFox上的问题 //>

3> 特殊标记

 

IE6能识别*,但不能识别!important,

IE7能识别*,也能识别!important;

FF不能识别*,但能识别!important;

IE6支持下划线,IE7和firefox均不支持下划线。

针对IE7 不错的hack方式就是使用“*+html”

* html #abc { color: #666; }
*+html #abc { color: #999; }

background:orange;(for IE8,FF)+background:green;(for IE7)_background:blue;(for IE6)

 

4> 自动折行

IE中设置长段落自动换行在CSS中设置word-wrap:break-word

5> 伪对象

 

#box:after{
content: “.”;
display: block;
height: 0;
clear: both;
visibility: hidden;
}

CSS 兼容 总结

标签:

原文地址:http://www.cnblogs.com/laneyfu/p/4193135.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!