.clearfix:before, .clearfix:after { content: "."; display: block; height: 0; overflow: hidden; } .clearfix:after { clear: both; } .clearfix { zoom: 1; /* IE < 8 */ }
来源:http://www.css-101.org/articles/clearfix/latest-new-clearfix-so-far.php
.clearfix:before, .clearfix:after { content: "."; display: block; height: 0; overflow: hidden; } .clearfix:after { clear: both; } .clearfix { zoom: 1; /* IE < 8 */ }
来源:http://www.css-101.org/articles/clearfix/latest-new-clearfix-so-far.php