繼上回的 [ float 的新朋友 clearfix 與 clear 的三腳關係 ] 後
再讓我們來看看故事是怎樣發展下去的
傳說中 .clearfix 也不是一開始就長得這樣的
他的人生有起有伏 跌跌撞撞
而這是他目前的模樣 ( 來自於 bootstrap http://twitter.github.com/bootstrap/ )
傳說中 .clearfix 也不是一開始就長得這樣的
他的人生有起有伏 跌跌撞撞
而這是他目前的模樣 ( 來自於 bootstrap http://twitter.github.com/bootstrap/ )
<style>
.clearfix:before,
.clearfix:after {
display:table;
line-height:0;
content:"";
}
.clearfix:after {
clear:both;
}
.clearfix {
*zoom: 1;
}
</style>
.clearfix 裡面有 pseudo class 的 after 相信有認真看上一篇的同學不會有問題
但為什麼要有 before 呢
