解决clearfix省去一个div的做法

2010-03-05 11:51:17 by 【6yang】, 41 visits, 收藏 | 返回

<style type="text/css">
.clearfix:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
/* Hides from IE-mac */
* html .clearfix{height:1%;}*+html .clearfix{height:1% !important;}
/* End hide from IE-mac */

</style>
<div style="border:2px solid red;" class="clearfix">
    <div style="float:left;width:80px;height:80px;border:1px solid blue;">TEST DIV</div>
    <div style="float:left;width:80px;height:80px;border:1px solid blue;">TEST DIV</div>
    <div style="float:left;width:80px;height:80px;border:1px solid blue;">TEST DIV</div>
    <div style="float:left;width:80px;height:80px;border:1px solid blue;">TEST DIV</div>
   <div  style="float:left;width:80px;height:80px;border:1px solid blue;">TEST DIV</div>
</div>

分享到:
share

    图片原图

    loading

    loading