网上有关“css里面怎么用hack清楚浮动”话题很是火热,小编也是针对css里面怎么用hack清楚浮动寻找了一些与之相关的一些信息进行分析,如果能碰巧解决你现在面临的问题,希望能够帮助到您。
1、子任用的最多的一种 clearfix hack
view sourceprint
01..clearfix:after{
02.display:block;
03.clear:both;
04.height:0;
05.line-height:0;
06.visibility:hidden;
07.content:".";
08.font-size:0;
09.}
10..clearfix{
11.zoom:1;
12.}
2、比较常见的另一种 clearfix hack
view sourceprint
01..clearfix:after {
02.content: ".";
03.display: block;
04.clear: both;
05.visibility: hidden;
06.line-height: 0;
07.height: 0;
08.}
09..clearfix {
10.display: inline-block;
11.}
12.html[xmlns] .clearfix {
13.display: block;
14.}
15.* html .clearfix {
16.height: 1%;
17.}
最近比较火的一种 clearfix hack
作者博客:A new micro clearfix hack
view sourceprint
01..cf:before,
02..cf:after {
03.content: " ";
04.display: table;
05.}
06..cf:after {
07.clear: both;
08.}
09..cf {
10.*zoom: 1;
11.}
其他两种方法 clearfix hack
摘自:XHTML float clear without markup test
.clearfix with IE8
view sourceprint
01./* full clearfix */
02./* add to floating elements which shall clear floating after themselves */
03.* html .clearfix {
04.height: 1%; /* IE5-6 */
05.}
06.*+html .clearfix {
07.display: inline-block; /* IE7not8 */
08.}
09..clearfix:after { /* FF, IE8, O, S, etc. */
10.content: ".";
11.display: block;
12.height: 0;
13.clear: both;
14.visibility: hidden;
15.}
已测试版本:
FF3.6, 3.5, 3, 2.0.0.16, 1.5, Camino
IE9PR3, 8, 7, 6, 5.5, 5.01, IE5Mac
Opera 9.51, 9.27, 8.5
Chrome 5
Safari 3.1.1 (PC, should work on Mac too)
关于“css里面怎么用hack清楚浮动”这个话题的介绍,今天小编就给大家分享完了,如果对你有所帮助请保持对本站的关注!
评论列表(3条)
我是长恒号的签约作者“松雪baby”
本文概览:网上有关“css里面怎么用hack清楚浮动”话题很是火热,小编也是针对css里面怎么用hack清楚浮动寻找了一些与之相关的一些信息进行分析,如果能碰巧解决你现在面临的问题,希望...
文章不错《css里面怎么用hack清楚浮动》内容很有帮助