:after伪类+content 清除浮动的影响实例页面

代码:

CSS代码:
.box{padding:10px; background:gray;}
.fix{*zoom:1;}
.fix:after{display:block; content:"clear"; height:0; clear:both; overflow:hidden; visibility:hidden;}
.l{float:left;}
                
HTML代码:
<div class="box fix">
    <img class="l" src="//image.zhangxinxu.com/image/study/s/s256/mm1.jpg" />
</div>
                

效果: