I have a HTML select, and using the Chosen JS plugin, for multiple select.
Chosen uses the CSS property background-image and others to set the style for each select option (always the same style). Buy I would like to set each option with its own color when selected.
This is an example I tried (just to try) but it didn't work (of course lool):
<select name="prueba" multiple class="form-control chosen-select"> <option style="background-image: linear-gradient(to bottom, #CCC 0%, #CCC 0%);">option1</option> <option style="background-image: linear-gradient(to bottom, #000 0%, #000 0%);">option2</option> </select>
The color is not about the position, it is based in a property of the model and it will be assigned dynamically
I don't think there is a native code to do that.
I think you should try to write a custom select (like dropdown menu of Bootstrap)