Solution to float causing layer to float out of parent layer_Experience exchange

WBOY
Release: 2016-05-16 12:06:03
Original
1341 people have browsed it
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.
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template