Skip to content

Instantly share code, notes, and snippets.

@liveme
Last active August 29, 2015 13:57
Show Gist options
  • Save liveme/9680112 to your computer and use it in GitHub Desktop.
Save liveme/9680112 to your computer and use it in GitHub Desktop.
clearfix
/*
*@ Name: 闭合浮动
*@ Update: 2013-02-17
*@ Usage: 在需要闭合浮动的元素上(浮动元素的父容器)加 .clearfix
*/
.clearfix:after {
visibility: hidden;
display: block;
content: ".";
font-size: 0;
height: 0;
clear: both;
}
.clearfix {
*zoom: 1; /* IE6-7 触发 hasLayout */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment