简体   繁体   English

样式复选框 - 更改标签颜色

[英]Styling the Checkbox - Changing the label color

It almost works, except on the checked state, I can't change the label color. 它几乎可以工作,除了在检查状态,我不能改变标签颜色。

input[type="checkbox"].custom:checked label {
    color: #fff;    
}

http://jsbin.com/vupow/1/ http://jsbin.com/vupow/1/

  1. Remove the :before selector 删除:before选择器
  2. You can also just merge the two css entries into one 您也可以将两个css条目合并为一个

.

input[type="checkbox"].custom:checked + label {
background: #1c6db5;
color: #ffffff; 
}

jsBin jsBin

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM