标签:内容 block padding 伪元素 wrap round 两种方法 after height
可以有两种方法:
1.添加overflow:hidden;
2.添加伪元素
<style>
.wrap{
border:1px solid blue;
width:600px;
margin:0 auto;
padding:20px 0;
}
.main{
float:left;
background:pink;
width:350px;
height:100px;
}
.side{
float:left;
background:rosybrown;
width:200px;
height:100px;
}
.wrap:after{
content:‘‘;
display:block;
height:0;
clear:both;
}
</style>
<div class="wrap">
<div class="main"></div>
<div class="side"></div>
</div>
标签:内容 block padding 伪元素 wrap round 两种方法 after height
原文地址:http://www.cnblogs.com/rachelch/p/7497888.html