Skip to content

Instantly share code, notes, and snippets.

@QETHAN
Created June 20, 2014 04:35
Show Gist options
  • Save QETHAN/29dc63b5a9839ec663f3 to your computer and use it in GitHub Desktop.
Save QETHAN/29dc63b5a9839ec663f3 to your computer and use it in GitHub Desktop.
清除浮动
/*简洁版*/
.clearfix:before, .clearfix:after {
content:"";
display:table;
}
.clearfix:after{
clear:both;
overflow:hidden;
}
.clearfix{
zoom:1;
}
/* 经典版 */
.clearfix:after {
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
* html .clearfix { zoom: 1; } /* IE6 */
*:first-child+html .clearfix { zoom: 1; } /* IE7 */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment