Skip to content

Instantly share code, notes, and snippets.

@steveosoule
Created October 30, 2012 23:21
Show Gist options
  • Save steveosoule/3983743 to your computer and use it in GitHub Desktop.
Save steveosoule/3983743 to your computer and use it in GitHub Desktop.
CSS Clearfix
/*
Version 1: Older and Longer
.clearfix:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
.clearfix {
display: inline-block;
}
html[xmlns] .clearfix {
display: block;
}
* html .clearfix {
height: 1%;
}*/
/* New Version */
.clearfix:before, .container:after { content: ""; display: table; }
.clearfix:after { clear: both; }
/* IE 6/7 */
.clearfix { zoom: 1; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment