You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Bootstrap Dropdown Select自定义CSS加!important规则不生效问题排查

解决方案

问题出在你的CSS选择器没有命中选中后回显到下拉按钮区域的乘数文本,仅覆盖了下拉菜单内部选中项的样式,新增以下两条CSS规则即可解决:

/* 下拉菜单展开时,已选中菜单项的乘数文本颜色 */
.bootstrap-select .dropdown-menu li.active small.text-muted {
    color: #0d75d2 !important;
}

/* 选中后回显到下拉框顶部按钮的乘数文本颜色 */
.bootstrap-select .filter-option-inner-inner small.text-muted {
    color: #0d75d2 !important;
}

如果上述规则仍未生效,可以通过增加父类选择器提高优先级,比如给选择器加上你的下拉框专属类名.a_level:

.a_level.bootstrap-select .filter-option-inner-inner small.text-muted {
    color: #0d75d2 !important;
}

内容的提问来源于stack exchange,提问作者Snake93

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.04 07:36:01