【发布时间】:2017-10-26 13:53:06
【问题描述】:
我正在使用jQueryUI checkboxes without icon,但找不到如何使用 CSS 修改/覆盖复选框样式。
例如,我想在“选中”按钮上添加红色边框,但以下 CSS 不起作用(我从 DevTools 元素窗格中推断出类):
.ui-checkboxradio-label .ui-corner-all .ui-button .ui-widget .ui-checkboxradio-checked .ui-state-active {
border: 2px solid rgb(255,0,0) !important;
}
.checkbox-noicon .ui-checkboxradio .ui-helper-hidden-accessible {
border: 2px solid rgb(255,0,0) !important;
}
我也试过直接修改输入的“checked”状态的样式,同样没有效果:
input[type=checkbox]:checked {
border: 2px solid rgb(255,0,0) !important;
}
我做错了吗?
【问题讨论】:
-
第一个解决方案..我认为太多的空间。如果该类来自一个元素,则它喊叫没有空格。例如 .ui-checkboxradio-checked.ui-state-active 第二个解决方案应该在硬刷新后工作(ctrl + f5 或 ctrl + shit+ r for chrome)