
第一种方法是外边距+固定宽度+浮动
还有什么方法?越多越好,谢谢。
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
<style>
.box1{
width: 200px;
height: 100px;
float: left;
background: blue;
margin-left: -100%;
}
.box2{
width: 100%;
float: left;
height: 100px;
background: red;
}
.box3{
width: 100%;
height: 100px;
background: yellow;
float: left;
}
.box2_wrap{
margin-left: 200px;
}
</style>
<div id="container">
<div class="box2">
<div class="box2_wrap">box2</div>
</div>
<div class="box1">box1</div>
<div class="box3">box3</div>
</div>