I want to give the yellow color to the selected items in multiselect dropdown box. By default it has gray background after selecting,
I want to do this in HTML, CSS
.
Can any one help in this?
I want to give the yellow color to the selected items in multiselect dropdown box. By default it has gray background after selecting,
I want to do this in HTML, CSS
.
Can any one help in this?
The following should work (for browsers that allow styling option tags), however the default select styling will override in most cases. You may be able to find a way to disable this however:
css
javascript
markup
Pure CSS would help here:
You can't. The
<option>
element does not accept CSS styling.We can simply do with the help of the below css.
select option:checked{ background: #1aab8e -webkit-linear-gradient(bottom, #1aab8e 0%, #1aab8e 100%); }
We can use JS to select the DOMs.
Demo : http://jsfiddle.net/TxbVt/1/
Add your own style inside the block.