Skip to content

Instantly share code, notes, and snippets.

@trumball
Created May 24, 2013 13:03
Show Gist options
  • Save trumball/5643344 to your computer and use it in GitHub Desktop.
Save trumball/5643344 to your computer and use it in GitHub Desktop.
CSS ClearFix This clearfix code has been around the Web for years circulating amongst savvy web developers. You should apply this class onto a container which holds floating elements. This will ensure any content which comes afterwards will not float but instead be pushed down and cleared.
.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