2017-10-12 26 views
0

我已經使用bootstrap 3框架創建了一個簡單的表單。現在我想從選擇框中增加組合框胡蘿蔔圖標的大小(圖中所示)。 enter image description here在Bootstrap中更改Combobox胡蘿蔔圖標大小

這是我的代碼

<div class="col-sm-6"> 
    <select class="form-control input-lg" id=""> 
     <option>1</option> 
     <option>2</option> 
     <option>3</option> 
     <option>4</option> 
    </select> 
</div> 

我是如何改變呢?

回答

1

使用以下CSS屬性:

select { 
     -webkit-appearance: none; 
     -moz-appearance: none; 
     appearance: none; 
     /* Some browsers will not display the caret when using calc, so we put the fallback first */ 
     background: url("http://cdn1.iconfinder.com/data/icons/cc_mono_icon_set/blacks/16x16/br_down.png") white no-repeat 98.5% !important; /* !important used for overriding all other customisations */ 
     background: url("http://cdn1.iconfinder.com/data/icons/cc_mono_icon_set/blacks/16x16/br_down.png") white no-repeat calc(100% - 10px) !important; /* Better placement regardless of input width */ 
    } 
+0

它的工作原理喬希。但我只想改變圖標。在使用你的代碼時,灰色邊框會變成透明的。 –

+0

好的,然後只使用背景屬性。 –

+0

我試過了。但它充滿了整個區域。的選擇列表。任何方式感謝您的答覆。我在等待一些回覆。如果我沒有得到任何答覆,我會批准你的答案。 –