15th May, 2008

Clearfix CSS

Do you have a problem with tricky clearing? Use this.

/* START CLEARING /
    .clearfix:after { clear: both; content: "."; display: block; height: 0; visibility: hidden; }
        /*.clearfix { display: inline-table; }*/
        / Hides from IE-mac \*/
        * html .clearfix { height: 1%; }
        .clearfix { display: block; }
        /* End hide from IE-mac /
/ END CLEARING */

 

The opinions expressed here are my own and not those of my employer.