how to change background color of selected items in multiselect dropdown box?
问题 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? 回答1: We can simply do with the help of the below css. select option:checked{ background: #1aab8e -webkit-linear-gradient(bottom, #1aab8e 0%, #1aab8e 100%); } 回答2: <style> .select2-container--default .select2-results__option[aria-selected=true] { background-color: inherit; color: lightgray; } </style>