Twitter bootstrap 使用引导在两列中显示复选框
我正在使用Bootstrap在两列中显示复选框。简短示例:Twitter bootstrap 使用引导在两列中显示复选框,twitter-bootstrap,css,Twitter Bootstrap,Css,我正在使用Bootstrap在两列中显示复选框。简短示例: <fieldset class="col-lg-6 col-md-12"> <label> <input type="checkbox" /> <span>Here is the text</span> </label> </fieldset> 这是文本 这是一幅 在图像中,您可以看到“transportatio
<fieldset class="col-lg-6 col-md-12">
<label>
<input type="checkbox" />
<span>Here is the text</span>
</label>
</fieldset>
这是文本
这是一幅
在图像中,您可以看到“transportation”(运输)复选框比其他复选框低很多
在某些屏幕尺寸下,如何防止复选框之间出现空白?
我无法更改标签的显示方式和其中的范围,但我可以向其中添加类。您需要将div对齐成一行,如下所示:
<div class = "container">
<div class="row">
<fieldset class="col-sm-6">
<label>
<input type="checkbox" />
<span>Here is the text</span>
</label>
</fieldset>
<fieldset class="col-sm-6">
<label>
<input type="checkbox" />
<span>Here is the text</span>
</label>
</fieldset>
</div>
</div>
这是文本
这是文本
您只需添加以下CSS:
ul {
column-count: 2;
column-gap: 2rem;
list-style: none;
}
在HTML中做了一些更改
<div class = "container">
<div class="row">
<div class="col-12">
<ul>
<li>
<label>
<input type="checkbox" />
<span>Here is the text</span>
</label>
</li>
<li>
<label>
<input type="checkbox" />
<span>Here is the text</span>
</label>
</li>
<li>
<label>
<input type="checkbox" />
<span>Here is the text</span>
</label>
</li>
<li>
<label>
<input type="checkbox" />
<span>Here is the text</span>
</label>
</li>
<li>
<label>
<input type="checkbox" />
<span>Here is the text</span>
</label>
</li>
</ul>
</div>
</div>
</div>
-
这是文本
-
这是文本
-
这是文本
-
这是文本
-
这是文本
你在说什么空间?您是否可以提供一个工作的JSFIDLE/…?OT:您应该添加一个图例
元素作为现有字段集
的第一个子元素,或者删除该字段集
。资源:我不知道@FelipeAls,谢谢你的链接!无法在此引导层中重现您的问题:请提供一个重现您的问题的“工作”层(如果您使用的是BS4,您必须重新开始一个新层,以便在一开始就选择BS4,或者记录以更改版本(我认为))“空白”正在发生,因为您的col-*
的内容高度不同。谢谢,我有一行和容器div,但问题仍然存在。