Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS: Dropdown option text color not working on Mac OS X

I want to set the color of the dropdown options text with value 1 to red.

My HTML dropdown:

<select name="ctl00$MainContent$TelephoneDD" id="MainContent_TelephoneDD" class="form-control">
    <option value="">Select</option>
    <option value="1">33534543534</option>
    <option value="1">78678678678</option>
    <option value="0">99923444445</option>
</select>

CSS:

#MainContent_TelephoneDD option[value="1"] {
  color: red;
}

This works in most of the browsers except in Chrome and Safari under Mac OS X.

Q: How can I make the dropdown options text color to red if the option value is 1 to work in Chrome under Mac OS X ?

like image 533
alex Avatar asked Sep 14 '25 01:09

alex


1 Answers

Styling of <option> tags is not currently supported by WebKit browsers on Mac OS X. You may find some more ideas here: Pure CSS solution to styling specific <select> options in webkit based browsers?.

like image 140
leekaiinthesky Avatar answered Sep 15 '25 15:09

leekaiinthesky