1

Does anyone know how to format HTML select/option lists without using multiple? I cannot get the CSS background-color to work at all. I have tried putting it on the select, I have tried putting it on the option, but nothing works.

(If I use multiple, then the formatting works, but I get other problems).

Martin Ellison
  • 1,043
  • 1
  • 13
  • 25
  • 2
    You mean the background of the "flyout" you get, when you open the select field? I don't think you can format that. You will need a custom solution to replace the native select field then, if this is really a requirement. – CBroe Mar 01 '22 at 13:07
  • Yeah, I've never seen that done either. You'd have to do something cool and fancy to accomplish that I suspect. Interesting that he's got it working with `multiple` though. – Lonnie Best Mar 01 '22 at 13:10
  • Does this answer your question? [How can I set the background color of – Tom Mar 01 '22 at 13:19
  • 1
    About `select` and `option` (and other inputs), each browser works differently (sadly). If you want full control over the design, you should build a custom solution with a bit of Javascript. – E-telier Mar 01 '22 at 17:34

0 Answers0