<div class="father">
<div class="me">
</div>
</div>
.father {
background-color: aqua;
}
.me {
width: 200px;
height: 200px;
background-color: red;
}
现在我们的效果是这样的
当把样式修改为
.me {
float: left;
width: 200px;
height: 200px;
background-color: red;
}
因为father
盒子我们没设置高度和宽度,之前显示出效果的原因是me
我们设置了高度,father
被撑开了。