我想將一個按鈕元素與兩個帶標籤的其他輸入元素對齊。用下面的引導片段:對齊帶有標籤的輸入表單的按鈕
<div class="row centered-form center-block ">
<div class="container col-md-6 col-md-offset-3">
<form action="/result" class="form-inline" method="get" role="form">
<div class="row">
<div class="form-group col-md-6">
<label class="control-label" for="County">Prop1, Prop2</label>
<input class="form-control" name="County" type="text" />
</div>
<div class="form-group col-md-4">
<label class="control-label" for="Type">Type of Election</label>
<select class="form-control" name="Type"><option value=""></option>
<option value="1">President</option>
</select>
</div>
<button class="btn btn-primary col-md-2" type="submit">Submit</button>
</div>
</form>
</div>
</div>
圖像我得到這個樣子的:
如果我從兩位來自輸入刪除標籤,我得到:
如何在表單輸入上留下標籤並仍然將它們與按鈕對齊?
您能提供一個完整的工作示例嗎?我測試代碼,它看起來沒問題。 – Dekel
[Bootstrap,將輸入與標籤對齊到沒有標籤的按鈕,垂直形式/不水平]可能的重複(http://stackoverflow.com/questions/31214255/bootstrap-align-input-with-label-to-button-without -label-vertical-form-not-h) – vanburen
@Dekel我加了一個小提琴。與IDE中的代碼完全相同,但在Fiddle中有不同的結果。 – hello