Skip to content

Instantly share code, notes, and snippets.

@thedaviddias
Created November 8, 2012 10:25
Show Gist options
  • Save thedaviddias/4037984 to your computer and use it in GitHub Desktop.
Save thedaviddias/4037984 to your computer and use it in GitHub Desktop.
CSS: Clearfix floats (group)
.group:before,
.group:after {
content: "";
display: table;
}
.group:after {
clear: both;
}
.group {
zoom: 1; /* For IE 6/7 (trigger hasLayout) */
}
@thedaviddias
Copy link
Author

"group" class name is nicer and more semantic (via Dan Cederholm). Content property doesn't even need the space, can be empty string (via Nicolas Gallagher). Without any text, font-size is un-needed (Chris Coyier).

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