【发布时间】:2017-01-09 16:04:02
【问题描述】:
我在这个网站上进行了广泛的搜索并尽力而为,但无法弄清楚如何将标签和输入放在同一行,现在它显示如下:label and input box are on different lines
首先,正如人们所建议的,我使用“form-group”类将它们分组,但没有运气。然后我继续搜索,有人说你应该使用我试过的“col-sm-1”,没有运气,有人说你应该使用“form-control-static”,但仍然没有运气。非常感谢任何帮助!
<div class="tab-content">
<div class="row" id="create_new_spa_form">
<form method= "post" action ="/purchasing/item_info_new_spa/" onsubmit="javascript: return validate();">
<div class="span4">
<div class="form-group">
<label class="control-label col-sm-1" for="input01">Text input</label>
<div class="controls col-sm-1">
<input type="text" class="form-control-static" id="input01">
</div>
</div>
</div>
<div class="span4">
<div class="form-group">
<label class="control-label" for="input01">Text input</label>
<div class="controls">
<input type="text" class="input-xlarge" id="input01">
</div>
</div>
</div>
<div class="span4">
<div class="form-group">
<label class="control-label" for="input01">Text input</label>
<div class="controls">
<input type="text" class="input-xlarge" id="input01">
</div>
</div>
</div>
</form>
</div>
</div>
按照 ZimSystem 的建议进行编辑后,现在看起来像这样:part of first label got truncated
我该如何解决这个问题?另外,如何调整输入框的大小?我不需要它们那么宽。
【问题讨论】:
-
您似乎在混合 Bootstrap 2 和 3 类。你用的是什么版本?
-
使用这个
-
对不起,它是 Bootstrap v2.2.2