Skip to content

Instantly share code, notes, and snippets.

@surrealist
Forked from djanix/css -> clearfix
Created March 20, 2012 13:41
Show Gist options
  • Select an option

  • Save surrealist/2135724 to your computer and use it in GitHub Desktop.

Select an option

Save surrealist/2135724 to your computer and use it in GitHub Desktop.
Clear after a float element for all browser and without addid aditionnal markup in the html
.clearfix:before,
.clearfix:after {
content: '\0020';
display: block;
overflow: hidden;
visibility: hidden;
width: 0;
height: 0;
}
.clearfix:after {
clear: both;
}
.clearfix {
zoom: 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment