【问题标题】:Change select 2 version 4 border color when it is opened打开时更改选择2版本4边框颜色
【发布时间】:2016-03-29 11:57:55
【问题描述】:

我尝试在打开时更改选择 2 版本 4 的边框颜色:

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

}

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

}

代码在:http://jsfiddle.net/7c0Lm033/

这是我得到的:

如您所见,我无法更改选择 2 头部颜色的颜色。我找不到任何可以更改标记颜色边框的唯一选择器。

【问题讨论】:

  • 看看我的回答可能对你有帮助

标签: jquery css jquery-select2-4 select2


【解决方案1】:

您可以将其添加到您的 css 中:

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

See fiddle

【讨论】:

    【解决方案2】:

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

    覆盖select2的css

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

    【讨论】:

      【解决方案3】:

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

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

      希望能起到作用

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2012-06-26
        • 1970-01-01
        • 2017-03-06
        • 2023-03-06
        • 2012-06-25
        • 1970-01-01
        • 2018-06-14
        相关资源
        最近更新 更多