How to style a select tag's option element?

前端 未结 6 1544
渐次进展
渐次进展 2020-11-22 11:03

I\'m trying to set the style of an option in a select dropdown menu in Google Chrome. It works in all browsers except IE9 and Chrome.

6条回答
  •  余生分开走
    2020-11-22 11:33

    Since version 49+, Chrome has supported styling elements with font-weight. Source: https://code.google.com/p/chromium/issues/detail?id=44917#c22

    New SELECT Popup: font-weight style should be applied.

    This CL removes themeChromiumSkia.css. |!important| in it prevented to apply font-weight. Now html.css has |font-weight:normal|, and |!important| should be unnecessary.

    There was a Chrome stylesheet, themeChromiumSkia.css, that used font-weight: normal !important; in it all this time. It was introduced to the stable Chrome channel in version 49.0.

提交回复
热议问题