- 父元素
overflow:hidden
- 父元素
float
- 父元素内结尾添加空
div
,设置属性clear:both
- 完美解决: 为父元素末尾伪元素设置
clear:both
::after { content: ''; clear: both; display: block; height: 0;}
overflow:hidden
float
div
,设置属性clear:both
clear:both
::after { content: ''; clear: both; display: block; height: 0;}