Is there any way to add padding to select options via CSS?

后端 未结 2 889
生来不讨喜
生来不讨喜 2020-12-03 21:03

I want to add some kind of space (padding, margin or whatever) between select options in HTML using CSS. I am currently using Chrome and I\'ve already tried using something

2条回答
  •  臣服心动
    2020-12-03 21:29

    Styling to select option is very much limited as to maintain a coherence and consistency among all the application in the operating system thus the browser are ought to restrict the style of some basic elements like in your case option tag.

    The restriction depends browser to browser, like padding and even margin of option tag works in the Mozilla Firefox while it doesn't work with Chrome.

    If it is very much necessary in you website to style the option tag then I suggest you to use some jQuery plugin (you can also make a drop down of your own, its simple).

提交回复
热议问题