1.父元素加class -- clearfix:after {content: ".";display: block;height: 0;clear: both;visibility: hidden;} * html .clearfix {height: 1%;}
2.子元素后加<div style="clear:both"></div> 或者给父元素加属性overflow:hidden;
3.父元素加属性display:table