clean-float-with-css

css to clean the float

.cc:after {content: ".";display: block;height:0;clear: both;visibility: hidden;}
.cc {display: inline-block;}
* html .cc {height: 1%;}
.cc {display: block;}
.c{clear:both;font:0px/0px Arial;overflow:hidden;height:0;width:0;}

Usage

###1

<!--after the float elements-->
<div class="c"></div>

2

<!--if the li is float use cc with ul class to clean float-->
<ul class="cc">
  <li></li>
  <li></li>
  <li></li>
</ul>