#Styling datalist

1 messages · Page 1 of 1 (latest)

neon forum
#

How can i style datalist html ?
actually i want to have my option width same as datalist width

high dune
#

datalist is just a tag, you can use it in css selectors like any other tag, combine it with class names etc. like

<datalist class="snowflake">
datalist.snowflake {
  ...
}
#

it seems the rendering of datalist is based on how the os/browser interprets it with its builtin widget, no way to override that. you can suppress it and add a custom widget/dropdown by tying to the events

https://chriswarrick.com/blog/2020/02/09/when-html-is-not-enough-a-tale-of-the-datalist-element/

https://codepen.io/sidd_dev/pen/qBRWNQQ

neon forum
#

ok ... lemme check it out

#

thx