CSS clearfix

The problem happens when a floated element is within a container box, that element does not automatically force the container’s height adjust to the floated element. When an element is floated, its parent no longer contains it because the float is removed from the flow. You can use 2 methods to fix it:

  • {clear: both;}
  • clearfix

Once you understand what is happening, use the method below to “clearfix” it.

Source code for webtoolkit.clearfix.css

 

posted @ 2015-07-03 09:49  网络虫  阅读(162)  评论(0编辑  收藏  举报