万能清除浮动样式 | CSS | 前端观察

我是创始人李岩:很抱歉!给自己产品做个广告,点击进来看看。  
<style type="text/css">
.clearfix:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.clearfix {display: inline-block;}  /* for IE/Mac */
 
</style><!-- main stylesheet ends, CC with new stylesheet below... -->
 
<!--[if IE]>
<style type="text/css">
.clearfix {
zoom: 1;     /* triggers hasLayout */
<span style="color: #aa0000;">display: block;     /* resets display for IE/Win */</span>
}  /* Only IE can see inside the conditional comment
and read this CSS rule. Don't ever use a normal HTML
comment inside the CC or it will close prematurely. */
</style>
<![endif]-->

随意打赏

提交建议
微信扫一扫,分享给好友吧。