Skip to content

Instantly share code, notes, and snippets.

@tysone
Created December 7, 2011 17:34
Show Gist options
  • Save tysone/1443720 to your computer and use it in GitHub Desktop.
Save tysone/1443720 to your computer and use it in GitHub Desktop.
/* http://sonspring.com/journal/clearing-floats */
.clear {
clear: both;
display: block;
overflow: hidden;
visibility: hidden;
width: 0;
height: 0;
}
/* http://www.yuiblog.com/blog/2010/09/27/clearfix-reloaded-overflowhidden-demystified */
.clearfix:before,
.clearfix:after {
content: '\0020';
display: block;
overflow: hidden;
visibility: hidden;
width: 0;
height: 0;
}
.clearfix:after {
clear: both;
}
/*
The following zoom:1 rule is specifically for IE6 + IE7.
Move to separate stylesheet if invalid CSS is a problem.
*/
.clearfix {
zoom: 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment