Skip to content

Instantly share code, notes, and snippets.

@eralston
Created May 13, 2011 16:34
Show Gist options
  • Save eralston/970845 to your computer and use it in GitHub Desktop.
Save eralston/970845 to your computer and use it in GitHub Desktop.
CSS Snippet for clearing after an element - http://www.positioniseverything.net/easyclearing.html
<style type="text/css">
.clearfix:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.clearfix {display: inline-block;} /* for IE/Mac */
</style><!-- main stylesheet ends, CC with new stylesheet below... -->
<!--[if IE]>
<style type="text/css">
.clearfix {
zoom: 1; /* triggers hasLayout */
display: block; /* resets display for IE/Win */
} /* Only IE can see inside the conditional comment
and read this CSS rule. Don't ever use a normal HTML
comment inside the CC or it will close prematurely. */
</style>
<![endif]-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment