Clear floats - cleaner clearfix


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

Add class \"clear\" to elements that contain floated elements and they will hold the height correctly


Copy this code and paste it in your HTML
  1. /* CLEAR FLOATS
  2. /* Add class "clear" to elements that contain floated elements and they will hold the height correctly
  3. /* updated: 01.10.2010
  4. *******************************************************/
  5. .clear:before,
  6. .clear:after {
  7. content: ".";
  8. display: block;
  9. height: 0;
  10. visibility: hidden;
  11. }
  12. .clear:after {clear: both;}
  13. .clear {zoom: 1;}
  14. /*******************************************************/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.