执行以下代码,为了清除浮动,下列做法可行且属于 BFC 应用的是()
<style>
.box1 {
width: 200px;
}
.box2 {
float: left;
width: 100px;
height: 100px;
}
</style>
<div class="box1">
<div class="box2"></div>
</div>
执行以下代码,为了清除浮动,下列做法可行且属于 BFC 应用的是()
<style>
.box1 {
width: 200px;
}
.box2 {
float: left;
width: 100px;
height: 100px;
}
</style>
<div class="box1">
<div class="box2"></div>
</div>
在 box1 盒子后面添加加代码:<div style="clear: both;"></div>
在 box2 盒子中设置属性:overflow: hidden
在 box1 盒子中设置属性:overflow: hidden
在 box2 盒子后面添加加代码:<div style="clear: both;"></div>