css clearfix

/* 清除浮动 */
html body div.clear, html body span.clear {
    background: none;
    border: 0;
    clear: both;
    display: block;
    float: none;
    font-size: 0;
    margin: 0;
    padding: 0;
    position: static;
    overflow: hidden;
    visibility: hidden;
    width: 0;
    height: 0;
    line-height: 0;
}

.clearfix:after {
    clear: both;
    content: ".";
    height: 0;
    display: block;
    overflow: hidden;
    visibility: hidden;
}

.clearfix {
    height: 1%;
    display: inline-block; /* for IE/Mac */
    zoom: 1; /* for ie6 & ie7 */
}

 

posted @ 2014-09-06 11:04  Mr.Leo  阅读(478)  评论(0编辑  收藏  举报