0

I wan't to do like coloured boxes in select options:

<select name="" id="dfads">
    <option value="">-</option>
    <option value="a"><span style="background:red">##</span> A</option>
    <option value="b">B</option>
    <option value="c">C</option>
</select>

The background work doesn't work in select option. Is it possible such simply?

0stone0
  • 34,288
  • 4
  • 39
  • 64
user2301515
  • 4,903
  • 6
  • 30
  • 46
  • 1
    Does this answer your question? [Change select box option background color](https://stackoverflow.com/questions/12836227/change-select-box-option-background-color) – 0stone0 Apr 07 '22 at 10:20
  • Are you trying to set the background of the option in the dropdown list, or the background of the select box when that specific option is selected? (The latter is possible, the former will be pretty unreliable due to the range of ways different browsers handle drop-downs) – DBS Apr 07 '22 at 10:22
  • `` isn't a valid child of an ` – ggorlen Apr 07 '22 at 13:47

0 Answers0