Return to Snippet

Revision: 54681
at January 10, 2012 22:51 by Huskie


Updated Code
.clear-fix:after{clear:both;content:'.';display:block;line-height:0;height:0;visibility:hidden;}
.clear-fix{zoom:1;}

Revision: 54680
at January 7, 2012 00:59 by Huskie


Initial Code
.clear-fix:after
{
    content: ".";
    display: block;
    clear: both;
    visibility: hidden;
    line-height: 0;
    height: 0;
}

.clear-fix
{
    zoom: 1;
}

Initial URL
http://darrenhuskie.com/

Initial Description
In my opinion, this is the best cross-browser method of clearing floated elements in a container. Remember to add .clear-fix{zoom:1;} to an IE specific stylesheet, otherwise IE 7 will complain.

Initial Title
Best Method for Clearing Floats

Initial Tags
css, best

Initial Language
CSS