Cleared elements


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

Hacer que un contenedor que contiene floats los abarque enteros, es decir, que realmente los contenga.

Bastaría con aplicar la clase .clearfix al contenedor


Copy this code and paste it in your HTML
  1. /* Para FF, Opera, etc. */
  2. .clearfix:after {
  3. content: ".";
  4. display: block;
  5. height: 0;
  6. clear: both;
  7. visibility: hidden;
  8. }
  9.  
  10. /* Para IE 5.x, 6, 7 */
  11. <!--[if IE]>
  12. <style>
  13. .clearfix {display: inline-block;}
  14. /* Hides from IE-mac \*/
  15. * html .clearfix {height: 1%;}
  16. .clearfix {display: block;}
  17. /* End hide from IE-mac */
  18. </style>
  19. <![endif]-->

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.