How to color a word in a dropdown?
css, html, xhtml
Solution
That's not possible with native `<select>` elements.
You can only color the whole option by setting the CSS `color` property on the `<option>` tag.
The common workaround to use "rich" content inside a dropdown box is replacing it with a JS-based one (i.e. where the dropdown is simply a div containing a list of elements).
Problem
Instead of coloring whole text, I want to color each word in a dropdown.. this don't seem to work? ``` <select> <option> Entry <span style="color:red">One</span> </option> <option> Entry <span style="color:red">Two</span> </option> <option> Entry <span style="color:red">Three</span> </option> </select> ```