How do you set the background color of an item in an HTML list?
This question is related to
html
select
background-color
Just like normal background-color: #f0f
You just need a way to target it, eg: <option id="myPinkOption">blah</option>
I assume you mean the <select>
input element?
Support for that is pretty new, but FF 3.6, Chrome and IE 8 render this all right:
<select name="select">
<option value="1" style="background-color: blue">Test</option>
<option value="2" style="background-color: green">Test</option>
</select>
_x000D_
I had this problem too. I found setting the appearance to none helped.
.class {
appearance:none;
-moz-appearance:none;
-webkit-appearance:none;
background-color: red;
}
Source: Stackoverflow.com