Skip to content

Instantly share code, notes, and snippets.

@joshfitzgerald
Created April 10, 2013 03:52
Show Gist options
  • Save joshfitzgerald/5351666 to your computer and use it in GitHub Desktop.
Save joshfitzgerald/5351666 to your computer and use it in GitHub Desktop.
css Clearfix
/* add .clearfix to any element that is “collapsed” due to floated child elements */
.clearfix:before,
.clearfix:after {
content: " ";
display: table;
}
.clearfix:after {
clear: both;
}
/* For IE 6/7 only */
.clearfix {
*zoom: 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment