Skip to content

Instantly share code, notes, and snippets.

@radermacher
Last active August 29, 2015 14:08
Show Gist options
  • Save radermacher/2065e9c5cce5e16ac8cd to your computer and use it in GitHub Desktop.
Save radermacher/2065e9c5cce5e16ac8cd to your computer and use it in GitHub Desktop.
/* Clear Floated Elements
----------------------------------------------------------------------------------------------------*/
/* http://sonspring.com/journal/clearing-floats */
.clear {
clear: both;
display: block;
overflow: hidden;
visibility: hidden;
width: 0;
height: 0;
}
/* http://perishablepress.com/press/2008/02/05/lessons-learned-concerning-the-clearfix-css-hack */
.clearfix:after {
clear: both;
content: ' ';
display: block;
font-size: 0;
line-height: 0;
visibility: hidden;
width: 0;
height: 0;
}
.clearfix {
display: inline-block;
}
* html .clearfix {
height: 1%;
}
.clearfix {
display: block;
}
.u-clearfix {
*zoom: 1;
&:before, &:after {
display: table;
content: " "
}
&:after {
clear: both;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment