Posted By

shapeshifta on 03/27/10


Tagged

clear clearfix


Versions (?)

The better clearfix


 / Published in: CSS
 

  1. /* for the normal browsers */
  2. .clearfix:after {
  3. clear:both;
  4. content:".";
  5. display:block;
  6. height:0;
  7. visibility:hidden;
  8. }
  9.  
  10.  
  11. /* for IE6+7 */
  12. /* sets hasLayout */
  13. * html .clearfix, *+html .clearfix {display:inline-block;}
  14.  
  15. /*hasLayout still set*/
  16. * html .clearfix, * html .clearfix {display:block;}

Report this snippet  

You need to login to post a comment.