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