参考一:From http://www.bitscn.com/school/HTMLCSS/201312/284207.html
.clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } .clearfix {display: inline-block;} /* for IE/Mac */ </style> <!--[if IE]> <style type="text/css"> .clearfix {zoom: 1;/* triggers hasLayout */ display: block;/* resets display for IE/Win *
参考二:http://www.jb51.net/css/67471.html
/* For modern browsers */ .cf:before,.cf:after { content:""; display:table; } .cf:after { clear:both; }/* For IE 6/7 (trigger hasLayout) */ .cf { zoom:1; }
参考三:from http://www.cnblogs.com/iloveyoucc/archive/2012/09/17/2688962.html
清除浮动方法: 1. .overflow1{overflow:hidden;zoom:1;} 2. .clearfix{display:block;} .clearfix:after{ clear: both; content: "."; display: block; height: 0; visibility: hidden; }