2014-05-23 85 views
0

我有一个内嵌输入的表单,但标签的大小似乎决定了输入框的大小。为什么Bootstrap中的输入标签决定了输入框的大小?

HTML

<div class="form-inline"> 
<div class="form-group"> 
<label for="address3">Town</label> 
<input type="text" name="sublocality" class="form-control fixedWidth" id="address3" placeholder="town"> 
</div> 
<div class="form-group"> 
<label for="address4">City</label> 
<input type="text" name="locality" class="form-control fixedWidth" id="address4" placeholder="City"> 
</div> 
</div> 

结果

enter image description here

我想所有的输入框是相同的宽度。

回答

0

用于您所有的form-groupcol-sm-*,例如:

<div class="form-group col-sm-3"> 
    <label for="address3">Town</label> 
    <input type="text" name="sublocality" class="form-control fixedWidth" id="address3" placeholder="town"> 
</div>