1:在父元素内添加一个空的子元素,设置clear:both清楚浮动; 2:在父元素后内容生成; parent:after{ content:” “; display:table; clear:both; }