Twitter bootstrap 桌面上有3列,平板电脑上有2列

Twitter bootstrap 桌面上有3列,平板电脑上有2列,twitter-bootstrap,twitter-bootstrap-3,Twitter Bootstrap,Twitter Bootstrap 3,我正在使用Bootstrap3,并试图显示多行,每行包含3个框。所有的盒子都是同样大小的,所以非常均匀。你可以把它描绘成一个网格。在平板电脑上,我只需要两列 <div class="row"> <div class="col-sm-6 col-md-4"> Uniform box of content here </div> <div class="col-sm-6 col-md-4"> Uniform box of content h

我正在使用Bootstrap3,并试图显示多行,每行包含3个框。所有的盒子都是同样大小的,所以非常均匀。你可以把它描绘成一个网格。在平板电脑上,我只需要两列

<div class="row">
   <div class="col-sm-6 col-md-4"> Uniform box of content here </div>
   <div class="col-sm-6 col-md-4"> Uniform box of content here </div>
   <div class="col-sm-6 col-md-4"> Uniform box of content here </div>
</div>

<div class="row">
   <div class="col-sm-6 col-md-4"> Uniform box of content here </div>
   <div class="col-sm-6 col-md-4"> Uniform box of content here </div>
   <div class="col-sm-6 col-md-4"> Uniform box of content here </div>
</div>

这里有统一的内容箱
这里有统一的内容箱
这里有统一的内容箱
这里有统一的内容箱
这里有统一的内容箱
这里有统一的内容箱
现在,这在我的桌面上非常有效。在移动设备上,它们都可以按需要折叠成一列。在平板电脑上,它们都分为两个阵营。然而,问题是,我有一个不均匀的列数分成偶数列。这将留下一行2,然后是一行1。然后,下一行创建一行2,后跟一行1


有没有简单的方法让下一行“弹出”来完成平板电脑上两列的行,同时在桌面上保持三列?目前,我的平板电脑上每隔一行都有空列。

不要将它们放在单独的行中,它应该按照您描述的方式运行

<div>
   <div class="col-sm-6 col-md-4"> Uniform box of content here </div>
   <div class="col-sm-6 col-md-4"> Uniform box of content here </div>
   <div class="col-sm-6 col-md-4"> Uniform box of content here </div>
   <div class="col-sm-6 col-md-4"> Uniform box of content here </div>
   <div class="col-sm-6 col-md-4"> Uniform box of content here </div>
   <div class="col-sm-6 col-md-4"> Uniform box of content here </div>
</div>

这里有统一的内容箱
这里有统一的内容箱
这里有统一的内容箱
这里有统一的内容箱
这里有统一的内容箱
这里有统一的内容箱

小提琴

看一下

上的“混合宽度列”部分,谢谢,这就成功了。不确定一行大于12是否有效,但它只是按预期将其推到下面。@BrandonSmith思考它的一种方式就像一个段落,每个div都是一个单词。每个单词都指定了一定数量的宽度单位,一行只能容纳12个单位。如果div不适合当前“行”,它将“包装”到下一行。在上面的示例中,每个div在中等或更大屏幕上的宽度为4个单位(因此形成2行3),在小屏幕上的宽度为6个单位(3行2),在x-small上的宽度为12个单位(6行1)。外部div可以看作段落本身。不确定这是否有帮助,但这就是我对BS3网格系统的看法。:)