Answers:
clear:both
使元素下降到文档中位于其之前的所有浮动元素之下。
您也可以使用clear:left
或clear:right
使其仅位于那些左右浮动的元素下方。
+------------+ +--------------------+
| | | |
| float:left | | without clear |
| | | |
| | +--------------------+
| | +--------------------+
| | | |
| | | with clear:right |
| | | (no effect here, |
| | | as there is no |
| | | float:right |
| | | element) |
| | | |
| | +--------------------+
| |
+------------+
+---------------------+
| |
| with clear:left |
| or clear:both |
| |
+---------------------+
只需添加到RichieHindle的回答,请Floatutorial,这将引导您完成CSS浮动和清算是如何工作的。