Skip to content

Instantly share code, notes, and snippets.

@jlong
Created June 24, 2011 22:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlong/1045839 to your computer and use it in GitHub Desktop.
Save jlong/1045839 to your computer and use it in GitHub Desktop.
3-column grid trick with nth-child clearing for variable height elements
section.three-column-grid {
clear: both;
width: 960px;
@include clearfix;
> section {
float: left;
padding: 0 10px;
width: 300px;
}
// Must have at least IE 9
> section:nth-child(3n+4) {
clear: both;
}
}
@jlong
Copy link
Author

jlong commented Jun 25, 2011

Sigh... it is a "rule of thumb"...

But thanks for the criticism. Definitely helps me think better about my HTML.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment