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 ?
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?.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With