1. Add clear empty div .clearfix:after {
content: “.”; display: block;
height: 0;
clear: both;
visibility: hidden;}
.clearfix {display: inline-block;}
/* Hides from IE-mac \*/
* html .clearfix {height: 1%;}
. clearfix {display: block;}/* End hide from IE-mac */
.clearfix {
display: block;
margin: 0px;
clear: both;
padding: 0px ;
visibility: hidden;
background-color:#666666;
border:0px none #FFFFFF;
}
.clearfix:after { height: 1px;}
Usage:
Add this layer after all floating layers
2. Add floating layers to the background layer, but this method will affect Other divs are sometimes useful.
3. There is also a problem with adding overflow, which will affect the appearance of the div.