Reputation: 11981
Please look this example:
select {
width: 172px;
height: 22px;
padding: 2px 7px;
border: none;
background: url(http://imgur.com/MJyZM.png) 0 0 no-repeat;
}
<select>
<option value="abcdefg">abcdefg</option>
<option value="1234567">1234567</option>
<option value="abcdefg">abcdefg</option>
</select>
https://jsfiddle.net/jeafgilbert/wz0zaev0/
Can someone please update it to be transparent in Chrome? Currently the result in FF is the correct one. Thanks.
Update:
Now without -webkit-appearance: none;
works fine in Chrome.
Upvotes: 31
Views: 114732
Reputation: 18721
select {
width:192px;
padding:2px;
border:none;
background:url(http://imgur.com/MJyZM.png) 0 0 no-repeat;
-webkit-appearance: none;
}
<select>
<option value="abcdefg">abcdefg</option>
<option value="1234567">1234567</option>
<option value="abcdefg">abcdefg</option>
</select>
Not tested on firefox but it seems -webkit-appearance: none;
disables specific behaviours webkit can apply.
Upvotes: 57