0
I’m trying to do the following Select:
I tried to do it this way, but I couldn’t:
HTML:
<select class="form-control">
<option>
<a title="Alimentação">
<span class="color" style="display: block; width:20px; height: 20px; background-color: rgb(255, 153, 0);"></span>
<span class="label">Alimentação</span>
</a>
</option>
...
</select>
Thus appeared only the text, the color did not.
You cannot have HTML within option. You will have to build your own select from scratch with js
– bfavaretto
Exactly: https://html.spec.whatwg.org/multipage/forms.html#the-option-element
– BrTkCa