Posted By

iqwebdev on 07/14/10


Tagged

hack clearfix


Versions (?)

Clearfix Hack


 / Published in: CSS
 

Just apply a class="clearfix" to the parent element.

  1. .clearfix:after {
  2. visibility: hidden;
  3. display: block;
  4. font-size: 0;
  5. content: " ";
  6. clear: both;
  7. height: 0;
  8. }
  9.  
  10. .clearfix { display: inline-block; }
  11. /* start commented backslash hack \*/
  12. * html .clearfix { height: 1%; }
  13. .clearfix { display: block; }
  14. /* close commented backslash hack */

Report this snippet  

You need to login to post a comment.