【发布时间】:2013-11-26 13:53:04
【问题描述】:
Here is a JSFiddle showing my code in action.
我想使用 Twitter Bootstrap 3 考虑响应性,以最正确的方式在表单的不同部分之间添加几个像素的间距。我查看了文档,但我仍然不清楚完成此操作的最佳方法是什么。
有什么想法吗?
这是我当前的 HTML 表单:
<form class="form-inline" role="form">
<div class="form-group">
<label class="sr-only" for="timezone">Timezone</label>
<select class="form-control" id="timezone" name="timezone">
<option value="America/St_Lucia">America/St_Lucia</option>
<option value="Europe/Nicosia">Europe/Nicosia</option>
</select>
</div>
<label class="radio-inline">
<input id="timeformat-0" name="timeformat" value="24" type="radio" />
19:00
</label>
<label class="radio-inline">
<input checked id="timeformat-1" name="timeformat" value="12" type="radio" />
7:00 PM
</label>
<button class="btn" type="submit">Save</button>
</form>
【问题讨论】:
-
水平间距还是垂直间距?哪些元素需要进一步分开?
-
水平间距!我希望在下拉列表和单选按钮组之间添加大约 10 像素的空间,以及在单选按钮组和保存按钮之间添加一些空间。我不需要在单选按钮之间留出更多空间。
-
尝试使用引导网格 (getbootstrap.com/css/#grid)。
-
@meavo:我对使用网格犹豫不决的原因是因为我不想改变元素(或组)的宽度,我只想要它们之间的空间它们稍微宽一些。
-
您不会找到 Bootstrap 输入间距变量。随心所欲地应用 CSS。输入大小有 LESS 变量,但间距没有。
标签: css html twitter-bootstrap responsive-design