Skip to content

Instantly share code, notes, and snippets.

@gwagroves
Created June 23, 2015 09:41
Show Gist options
  • Save gwagroves/518de4c2b262acac5184 to your computer and use it in GitHub Desktop.
Save gwagroves/518de4c2b262acac5184 to your computer and use it in GitHub Desktop.
clearfix SASS mixin
// Gives an element that only contains floated elements its "natural" height
// (Without using overflow: hidden)
@mixin clearfix {
&:after {
content: "";
display: table;
clear: both;
}
}
// usage
// .block-with-floats {
// @include clearfix;
// }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment