如何使用Bootstrap-3实现所需的布局?
HTML:
<div class="row">
<div class="col-md-5" col-md-push-7>
<div>1</div>
<div>3</div>
<div>
<div class="col-md-7" col-md-push-5>
<div>2</div>
</div>
</div>
答案 0 :(得分:1)
使用以下代码结构来实现此布局:
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-7 pull-right">1</div>
<div class="col-xs-12 col-sm-5">2</div>
<div class="col-xs-12 col-sm-7 pull-right">3</div>
</div>
</div>
.box {
border: 2px solid black;
margin-bottom: 10px;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-7 pull-right">
<div class="box">1</div>
</div>
<div class="col-xs-12 col-sm-5">
<div class="box box2">2</div>
</div>
<div class="col-xs-12 col-sm-7 pull-right">
<div class="box">3</div>
</div>
</div>
</div>