码迷,mamicode.com
首页 > Web开发 > 详细

css中的清除float影响,containing的div跟随floated sub的方法

时间:2015-09-17 17:09:37      阅读:147      评论:0      收藏:0      [点我收藏+]

标签:

/**
 * For modern browsers
 * 1. The space content is one way to avoid an Opera bug when the
 *    contenteditable attribute is included anywhere else in the document.
 *    Otherwise it causes space to appear at the top and bottom of elements
 *    that are clearfixed.
 * 2. The use of `table` rather than `block` is only necessary if using
 *    `:before` to contain the top-margins of child elements.
 */
.cf:before,
.cf:after {
    content: " "; /* 1 */
    display: table; /* 2 */
}

.cf:after {
    clear: both;
}

/**
 * For IE 6/7 only
 * Include this rule to trigger hasLayout and contain floats.
 */
.cf {
    *zoom: 1;
}

 

css中的清除float影响,containing的div跟随floated sub的方法

标签:

原文地址:http://www.cnblogs.com/kidsitcn/p/4816627.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!