I want to give the yellow color to the selected items in multiselect dropdown box. By default, it has gray background after selecting,
How to do this in HTML
, CSS
.
This question is about multiselect but for single select refer (Related but not duplicate of either): How to apply background-color to a selected option?
We can simply do with the help of the below CSS:
select option:checked{
background: #1aab8e -webkit-linear-gradient(bottom, #1aab8e 0%, #1aab8e 100%);
}
<style>
.select2-container--default .select2-results__option[aria-selected=true] {
background-color: inherit;
color: lightgray;
}
</style>
Add your own style inside the block.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With