3

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 ?

Mosh Feu
  • 28,354
  • 16
  • 88
  • 135
alex
  • 1,300
  • 1
  • 29
  • 64

1 Answers1

5

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?.

Community
  • 1
  • 1
leekaiinthesky
  • 5,413
  • 4
  • 28
  • 39