2014-02-21 50 views
0

如何在<select>元素上應用引導樣式。我沒有看到任何使用bootstrap css for <select>表單元素的可證明的例子。我不知道這是故意還是bootstrap與select元素很好地協作?請賜教。使用引導樣式選擇表單元素

enter image description here

添加了.form-control的風格,但選擇元素似乎是形式:)

+0

添加類.FORM控制給它的基本造型引導然後根據需要改變,在自己的CSS。 –

+0

@BillyMoat請參閱編輯 – sakhunzai

回答

1

disabled演示的引導文件上顯示了一個選擇在一個陌生的。從字段集刪除禁用給你的示例代碼:

<form role="form"> 
    <fieldset> 
    <div class="form-group"> 
     <label for="disabledTextInput">Disabled input</label> 
     <input type="text" id="disabledTextInput" class="form-control" placeholder="Disabled input"> 
    </div> 
    <div class="form-group"> 
     <label for="mySelect">Disabled select menu</label> 
     <select id="mySelect" class="form-control"> 
     <option>Disabled select</option> 
     <option>Disabled select</option> 
     <option>Disabled select</option> 
     <option>Disabled select</option>   
     </select> 
    </div> 
    <div class="checkbox"> 
     <label> 
     <input type="checkbox"> Can't check this 
     </label> 
    </div> 
    <button type="submit" class="btn btn-primary">Submit</button> 
    </fieldset> 
</form> 

見行動:jsfiddle

+0

謝謝,看起來很合理:) – sakhunzai