Select menu option border none

前端 未结 3 1831
走了就别回头了
走了就别回头了 2020-12-03 13:43

I am trying to change select option border but unable to do that, I have tried it many times but not find the proper solution. I have attached the screen shot .

相关标签:
3条回答
  • 2020-12-03 14:35

    As far as I have understood this is not possible, are properties that depend on each browser, no questions past that may make things a little clearer.

    Greetings.

    Perhaps this may be of help:

    How to style a <select> dropdown with CSS only without JavaScript?

    0 讨论(0)
  • 2020-12-03 14:35

    The short answer:

    THIS CAN'T BE DONE WITH A select ELEMENT

    Possible solution:

    Use any UI library (bootstrap, jquery UI, or any other) to make a custom select-like element, that you can style as you wish (they all generate a control using other, customization-friendly elements like ul, li, div....)

    0 讨论(0)
  • 2020-12-03 14:40

    The dropdown of a select is part of what's called the ShadowDOM. In the current CSS specs, level 3, there's no way to target most ShadowDOM elements. You can read the specs on the ShadowDOM here, though there's not much in there regarding what you want.

    Chrome has a few proprietary selectors to change some shadowDOM elements, but not all. Firefox has even fewer (as far as I know), and Opera has none. IE is probably just as bad or worse.

    Your best bet with compatibility in mind is to use a Jquery plugin to mimic the select using other HTML elements if you really want to style it. Here's a neat one.

    0 讨论(0)
提交回复
热议问题