Skip to content

Instantly share code, notes, and snippets.

@huobazi
Forked from jmblog/new-clearfix.css
Created May 18, 2011 07:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save huobazi/978137 to your computer and use it in GitHub Desktop.
Save huobazi/978137 to your computer and use it in GitHub Desktop.
new clearfix
/* new clearfix */
/* http://perishablepress.com/press/2009/12/06/new-clearfix-hack/ */
.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