Skip to content

Instantly share code, notes, and snippets.

@dannylloyd
Created October 9, 2011 03:02
Show Gist options
  • Select an option

  • Save dannylloyd/1273218 to your computer and use it in GitHub Desktop.

Select an option

Save dannylloyd/1273218 to your computer and use it in GitHub Desktop.
Fixes problem when float is applied to an element and the following elements are crowded around it
.clearfix:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
.clearfix {
display: inline-block;
}
html[xmlns] .clearfix {
display: block;
}
* html .clearfix {
height: 1%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment