Skip to content

Instantly share code, notes, and snippets.

@jeffreysbrother
Last active November 11, 2015 21:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffreysbrother/bbb95fc8c1f87dbd8950 to your computer and use it in GitHub Desktop.
Save jeffreysbrother/bbb95fc8c1f87dbd8950 to your computer and use it in GitHub Desktop.
/*
add the clearfix class to the parent element.
In my case, the border of a div was collapsing into a child button. This was caused by adding the "float": "left" rule to the button
(this occurs even when "clear": "right" is not added)
*/
.clearfix:after {
content: "";
display: table;
clear: both;
}
/*********************************
below is Nicolas Gallagher's micro clearfix hack
********************************/
.clearfix:before,
.clearfix:after {
content: " ";
display: table;
}
.clearfix:after {
clear: both;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment