Skip to content

Instantly share code, notes, and snippets.

@ryanburgess
Last active December 30, 2015 18:09
Show Gist options
  • Save ryanburgess/7865478 to your computer and use it in GitHub Desktop.
Save ryanburgess/7865478 to your computer and use it in GitHub Desktop.
Add clearfix to your CSS or a specific element using the Clearfix SASS mixin.
// -----------------------------------------
// Clearfix after element
// -------------------------------------------
// usage: @include clearfix();
@mixin clearfix() {
& {
*zoom: 1;
}
&:before,
&:after {
content: "";
display: table;
}
&:after {
clear: both;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment