Method of clearing floating: inner wall method
Note: This is a kinky trick, there is no principle to say, remember can
This technique also allows the parent box to re-open the height of the box.
Partition method-Suitable for up and down arrangement between 2 box
Since 2 box heights are still 0, the margin between each other is not in effect. You can use a wall to open it.
.cl { clear: both; } .h16 { height: 16px; }
<div class="box1"> <ul> <li>HTML</li> <li>CSS</li> <li>JS</li> </ul></div><div class="cl h16"></div><div class="box2"> <ul> <li>学习方法</li> <li>英语水平</li> <li>面试技巧</li> </ul></div>
Overflow:hidden
Note: This is a kinky trick, there is no principle to say, remember can
It also allows the parent box to open the height of the box.
Use of appendix Overflow:hidden
Indicates "overflow hiding". All the contents of the overflow border will be hidden away.
[CSS] float-clear floating method