Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a background color to HTML option?

Consider the following example: (live demo)

HTML:

<select>                          
    <option>Hello</option>    
    <option>Stack</option>
    <option class="a">Overflow</option>
</select>

CSS:

option.a {
    background-color: red;
}

On Windows in Chrome 17 the styling works as expected:

enter image description here

while on Mac in Chrome 17 it doesn't work:

enter image description here

Any ideas how to add a background color to <option> on Mac?

like image 610
Misha Moroshko Avatar asked Oct 09 '22 12:10

Misha Moroshko


1 Answers

It's a known bug in chrome. Styles don't get applied to options on the Mac.

like image 89
Kibbee Avatar answered Oct 13 '22 12:10

Kibbee