清除浮動
- 給父元素加高度
- clear:both; 但會導致margin失效
- 隔牆法
<div class=”cl h10”></div>
.cl {clear: both;}
// 控制間距
.h10 { height:10px}
- 給父元素增加overflow:hidden;IE6追加_zoom: 1;
瀏覽器前綴
- webkit 以webkit做內核的瀏覽器
- ms IE
- moz 火狐
- o opera
<div class=”cl h10”></div>
.cl {clear: both;}
// 控制間距
.h10 { height:10px}