如何通过boostrap方式制作红色单元格row-span=2
(也填充第二行)?
.cell {height: 100px; border: 1px solid; border-collapse:collapse;}
.red {background: red;}
.yel {background: lightyellow;}

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
rel="stylesheet"/>
<div class="col-xs-3 cell yel">content 1 -3</div>
<div class="col-xs-5 cell yel">content 2 -5</div>
<div class="col-xs-4 cell red">content 3 -4</div>
<div class="col-xs-5 cell yel">content 4 -5</div>
<div class="col-xs-3 cell yel">content 5 -3</div>
&#13;
答案 0 :(得分:1)
试试这段代码。
查看 CODEPEN
上的工作示例HTML:
Col.1 | Col.2 | Col.3 | Col.4 | Col.5 |
12345 | ABCD | 1A2B | empty | empty |
45678 | x1z2 | empty | empty | empty |
CSS:
<div class="row">
<div class="col-xs-8">
<div class="row">
<div class="col-xs-5 cell yel">content 1 -5</div>
<div class="col-xs-7 cell yel">content 2 -7</div>
<div class="col-xs-7 cell yel">content 4 -7</div>
<div class="col-xs-5 cell yel">content 5 -5</div>
</div>
</div>
<div class="col-xs-4 red">content 3 -4</div>
</div>
希望它对你有所帮助。
享受:)
答案 1 :(得分:1)
.pull-right
&amp;红行
.cell { min-height: 100px !important; outline: 1px solid; }
.red { background: red; }
.yel { background: lightyellow; }
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
rel="stylesheet"/>
<div class="container-fluid">
<div class="row red">
<div class="col-xs-3 cell yel">content 1 -3</div>
<div class="col-xs-5 cell yel">content 2 -5</div>
<div class="col-xs-4 pull-right">content 3 -4</div>
<div class="col-xs-5 cell yel">content 4 -5</div>
<div class="col-xs-3 cell yel">content 5 -3</div>
</div>
</div>
.pull-right
&amp; height: 200px;
.pull-right
class使此单元格正确浮动。
.cell { height: 100px; outline: 1px solid; }
.double-cell { height: 200px; outline: 1px solid; }
.red { background: red; }
.yel { background: lightyellow; }
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
rel="stylesheet"/>
<div class="container-fluid">
<div class="row">
<div class="col-xs-3 cell yel">content 1 -3</div>
<div class="col-xs-5 cell yel">content 2 -5</div>
<div class="col-xs-4 double-cell red pull-right">content 3 -4</div>
<div class="col-xs-5 cell yel">content 4 -5</div>
<div class="col-xs-3 cell yel">content 5 -3</div>
</div>
</div>