I'm trying to change the background color of a drop down list in HTML to transparent.
HTML
<select id="nname">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</select>
CSS
#nname {
padding: 5px;
color: #000;
font-size: 12px;
background: transparent;
-webkit-appearance: none;
}
however, the background stays white and the text stays black. Any ideas?
Best Answer
You can actualy fake the transparency of
option
DOMElements with the following CSS:CSS
See Demo
The
option
tag does not supportrgba
colors yet.