清除浮动的几种方法

HTML

<div class="box clear">
    <img src="/images/1.jpg">
</div>

CSS

.box {
    padding: 10px;
    background-color: #cd0000;
}
.box > img {
    float: left;
}
.clear:after {
    content: "";
    display: 'block';或display: 'table';或display: 'list-item'(会有列表小圆点);
    clear: both; }