清除浮动的方法一般有很多种,我们都是根据实际情况或者自己的习惯来清除浮动,最近发现一种比较常用的清除浮动的方法;


  

.cf:before,
.cf:after {
content: " ";
display: table;
}

.cf:after {
clear: both;
}

/**
* For IE 6/7 only
* Include this rule to trigger hasLayout and contain floats.
*/
.cf {
*zoom: 1;
}

   其实主要是利用了:berfore 和:after方法来实现,比起以前的方法简单了一点