Skip to content

Instantly share code, notes, and snippets.

@maxxscho
Created March 7, 2012 10:08
Show Gist options
  • Save maxxscho/1992354 to your computer and use it in GitHub Desktop.
Save maxxscho/1992354 to your computer and use it in GitHub Desktop.
CSS: Clearing (from Skeleton)
/* CLEARING
============================================================================ */
/* Self Clearing Goodness */
.container:after { content: "\0020"; display: block; height: 0; clear: both; visibility: hidden; }
/* Use clearfix class on parent to clear nested columns,
or wrap each row of columns in a <div class="row"> */
.clearfix:before,
.clearfix:after,
.row:before,
.row:after {
content: '\0020';
display: block;
overflow: hidden;
visibility: hidden;
width: 0;
height: 0;
}
.row:after,
.clearfix:after {
clear: both;
}
.row,
.clearfix {
zoom: 1;
}
/* You can also use a <br class="clear" /> to clear columns */
.clear {
clear: both;
display: block;
overflow: hidden;
visibility: hidden;
width: 0;
height: 0;
}
hr.clear {
margin: 0;
border: 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment