【发布时间】:2016-03-01 21:38:23
【问题描述】:
我对使用 Bootstrap 的嵌套行有一些误解...
- 假设我有一个 1200 像素的容器。
- 然后我有一个带有 col-lg-4 的第一个 div,这意味着第一级为 400 像素。
- 在这个 col-lg-4 中,我创建了一个二级行,我的理解是新行将充当容器。
应该使用新的行宽来计算列细分,这里 400px 表示“col-xs”,我理解错了吗?
<div class="container" style="border:1px solid">
<div class="row">
Let's say the container is 1200px
</div>
<div class="row">
<div class="col-lg-4">
<div class="row" style="border:1px solid blue;">
This div size should be 1200/4=300px (which means <b>col-xs</b> only should be active)
</div>
<div class="col-sm-6 col-md-4 col-lg-3">
<div style="border:1px solid red;">
But it is always using col-lg-3, instead of col-sm-6
</div>
</div>
</div>
</div>
How can I have the red box to use the <b>xs/sm</b> size and use half of the 300px ?
</div><!-- /.container -->
从给定的示例中,我如何让红色节点使用 col-sm-6 而不是 col-lg-3?
我需要让他认为它是在小屏幕上而不是在大屏幕上......
【问题讨论】: