Styling autocomplete dropdowns in browsers

后端 未结 2 1493
说谎
说谎 2020-12-03 22:13

On many websites, when typing in a username for example, a dropdown occurs where previous input shows up so the user can easily select something instead of typing. I know yo

相关标签:
2条回答
  • 2020-12-03 23:00

    Nope. Autocomplete is not a part of any standard, and is not part of the DOM. The only way to style is, as you've suggested yourself, by recreating that functionality using JavaScript.

    0 讨论(0)
  • 2020-12-03 23:03

    Unfortunately there is no way to style the drop down box itself with CSS, because in this case (when not using javascript/jQuery/mootools/etc.) it is operating system dependent - i.e Windows/Linux/Mas OS visualize it according the visual user settings (i.e scheme).

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