存在父元素 方法一:父元素添加 overflow:hidden 方法二:父元素同子元素一起添加 float:left 方法三:在末尾添加一个子元素 content:'';display:block;clear:both 不存在父元素 同方法三