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!)

About this user

« Newer Snippets
Older Snippets »
1 total  XML / RSS feed 

Clear Floats Without Structural Markup

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 */
« Newer Snippets
Older Snippets »
1 total  XML / RSS feed