Styling the first option of a <select> input on iOS

前端 未结 3 1063
死守一世寂寞
死守一世寂寞 2020-12-06 07:12

I\'m trying to style a select input on iOS. The first option or initial state should have smaller font-size but not the rest of the options.

I have the

3条回答
  •  一生所求
    2020-12-06 08:04

    Unfortunately, there isn't a way to do it. iOS Safari takes full control of styling select lists' internal contents. Here's a reference for verification: little link.

    One way to achieve this this would be to simulate the dropdown/select menu using JavaScript.

    It's not very preferable, but if you absolutely require to change the default styling, then I'm afraid it's the only way to go; here's a demo that should give you an idea on how to do the simulation: another little link.

提交回复
热议问题