The better clearfix


/ Published in: CSS
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.