Bootstrap列增加到12个,但仍在包装中

Bootstrap columns add to 12 but are still wrapping

本文关键字:包装 增加 12个 Bootstrap      更新时间:2023-12-08

我有一个引导行,它的列加起来有12列。断章取义,它们是:

class="col-md-1 control-label"
class="col-md-2"
class="col-md-1 control-label"
class="col-md-2"
class="col-md-1 control-label"
class="col-md-1"
class="col-md-1"
class="col-md-1 control-label"
class="col-md-1"
class="col-md-1"

=12!!!

然而,由于某种原因,第二个只读字段正在包装。有人知道为什么会发生这种情况吗?

这是一把小提琴:http://jsfiddle.net/qrzb2ann/

在标记中有两个额外的label不是col-*,所以它去掉了间距(尽管对我来说它没有换行)。

我认为你不需要有空标签。如果要保留它们,请使用pull-left,使它们浮动:向左,不影响栅格。

<label class="pull-left"></label>

http://www.bootply.com/CxMOq6ARs3

编辑:每个输入都应该有如文档中所述的标签,因此在空标签上使用sr-only类,这样它们就不会影响网格列。