将 an 附加input-group到 aform-inline时, 将input-group出现在表单下方的“新行”上,而不是与其他控件内联。
这似乎是因为input-group包装类已display设置为,table而其他工作正常的输入display设置为inline-block. 当然,不可能给出显示input-group,inline-block因为它的子add-on跨度有display: table-cell,需要父级的属性才能正确对齐。
所以我的问题是:是否可以input-group在内联表单中仅使用 Bootstrap 类?如果不是,那么允许使用自定义类的最佳解决方法是什么。
这是一个演示我的观点的演示。代码如下:
<form action="" class="form-inline">
<input type="text" class="form-control" placeholder="Works with" style="width: 100px;"/>
<input type="text" class="form-control" placeholder="Text Inputs" style="width: 120px;"/>
<div class="checkbox">
<label>
<input type="checkbox" /> and Checkboxes
</label>
</div>
<select class="form-control" style="width: 150px;">
<option>and Selects</option>
</select>
<button type="submit" class="btn btn-default">and Buttons</button>
<div class="input-group" style="width: 220px;">
<span class="input-group-addon">BUT</span>
<input type="text" class="form-control" placeholder="not with input-groups" />
</div>
</form>