问题
I'm using bootstrap-select (from Silvio Moreto). I would like to change background-color and font color of list item. By default is :
And I would like something like :
I tried this, but nothing change :
.bootstrap-select.btn-group .dropdown-menu li:hover{
background-color: rgb(191, 82, 121);
color: white;
}
Any idea ?
回答1:
I answered my own question :
.bootstrap-select.btn-group .dropdown-menu li a:hover {
color: whitesmoke !important;
background: #bf5279 !important;
}
Thanks ;-) !
回答2:
Without a demo or live-site my only guesses would be to either use "!important" on background-color or check if your css selector ist right. What happens, if you change outline or border? If nothings happens, i would think, that your selector is wrong or your css isn´t even included.
回答3:
I have changed all of them with something like this:
button[data-toggle="dropdown"].btn-default,
button[data-toggle="dropdown"]:hover {
background-color: white !important;
color: #2c3e50 !important;
border: 2px solid #dce4ec;
}
来源:https://stackoverflow.com/questions/39661592/how-to-change-background-color-option-in-bootstrap-select