<div class="father">
<span>测试xxx</span> <span>测试xxx</span>
<!--方法3.<div style="clear: both"></div>-->
</div>
方法1. 父盒子加 .father {overflow: hidden;}
方法2. 父盒子添加伪元素 .father:after{content: "";clear: both; display:block;overflow: hidden;}
网友评论