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

江枫思渺然 提交于 2019-12-02 06:20:25

问题


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 ?


回答1:


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



来源:https://stackoverflow.com/questions/28974069/css-dropdown-option-text-color-not-working-on-mac-os-x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!