简体   繁体   中英

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/

  1. Remove the :before selector
  2. You can also just merge the two css entries into one

.

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

jsBin

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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