解决子元素浮动之后,父元素不被撑开的问题

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

posted @ 2017-07-21 17:52  Poppyヽ彤  阅读(455)  评论(0编辑  收藏  举报