Skip to content

Instantly share code, notes, and snippets.

@DeanPoulin
Created January 11, 2014 09:47
Show Gist options
  • Select an option

  • Save DeanPoulin/8368930 to your computer and use it in GitHub Desktop.

Select an option

Save DeanPoulin/8368930 to your computer and use it in GitHub Desktop.
Clearfix
<!-- Usage as a class -->
<div class="clearfix">...</div>
<style type="text/css">
/* Mixin itself */
.clearfix() {
&:before,
&:after {
content: " ";
display: table;
}
&:after {
clear: both;
}
}
/* Usage as a Mixin */
.element {
.clearfix();
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment