#father{
border:1px #000 solid
}
.layer01{
border:1px #F00 dashed;
display: inline-block;
float: left;
}
.layer02{
border:1px #F00 dashed;
display: inline-block;
float: left;
}
.layer03{
border:1px #F00 dashed;
display: inline-block;
float: right;
}
/*
clear:left; 左侧不允许有浮动元素
clear:right; 右侧不允许有浮动元素
clear:both; 两侧不允许有浮动元素
*/
#father{
border:1px #000 solid;
height: 500px;
}
.clear{
clear: both;
}
在父级元素中增加一个 overflow:hidden
#father:after{
content: '';
display: block;
clear: both;}
链接:https://blog.csdn.net/clover_page/article/details/130100672
作者:
永乐高官方网站教育技术与网络中心版权所有
© by GDAFC Education Technology & Network Center, All Rights Reserved.