1

I have tried to change the border color of select 2 version 4 with when it is opened:

.select2-dropdown--above {
    border: 1px solid blue !important;;
    border-bottom: none !important;  

}

.select2-dropdown--below{
    border: 1px solid blue !important;;
    border-top: none !important;     

}

Code at: http://jsfiddle.net/7c0Lm033/

Here is what I get:

select 2

As you can see I can not change the color of select 2 head color. I could not find any unique selector which can change the marked color border.

4

3 回答 3

7

您可以将其添加到您的 CSS:

span.select2-selection--multiple[aria-expanded=true] {
    border-color: blue !important;   
}

见小提琴

于 2015-12-23T05:27:53.293 回答
4

看这个例子:http: //jsfiddle.net/kevalbhatt18/7c0Lm033/2/

覆盖select2的css

.select2-container--default.select2-container--focus .select2-selection--multiple{
   border: 1px solid blue !important;;

}

于 2015-12-23T05:28:28.163 回答
0

我认为您可以简单地使用以下代码通过下面的单行代码使箭头指向蓝色的区域

$('.select2-selection').css('border-color','blue');

希望它有一个目的

于 2019-09-18T08:28:51.110 回答