Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Clear Floats Without Structural Markup (See related posts)

This should allow you to clear floats in css, without adding extra elements. Add class="clearfix" to elements that need to be cleared. This should work in IE7 as well.

.clearfix:after {
content:".";
display:block;
height:0;
clear:both;
visibility:hidden;
}

.clearfix {display:inline-block;}
/* Hide from IE Mac \*/
.clearfix {display:block;}
/* End hide from IE Mac */

You need to create an account or log in to post comments to this site.


Related Posts