/*清除浮动代码*/ .clearfloat:after{display:block;clear:both;content:"";visibility:hidden;height:0} .clearfloat{zoom:1}
<!--第一个div--> <div class="div1 clearfloat"> <div class="left"> Left </div> <div class="right"> Right </div> </div> <!--第二个div--> <div class="div2"> div2 </div>