Reputation: 13
I need to have two labels for one input field with different styles.
For some reason this code doesn't work. It does work perfectly for first label, and only partially for second label.
this code works
input.switcher[type=checkbox] + label + label
but this doesn't (second label doesn't change color by checking on and off)
input.switcher[type=checkbox]:checked + label + label
any advice how to solve this issue is appreciated!
http://jsfiddle.net/dantetemp/tLPkk/
Upvotes: 1
Views: 2433
Reputation: 59859
Strangely it seems to work (in Chrome 28 - where I presume you have the problem judging by the comments) if you change the adjacent sibling combinator to the general sibling combinator, ~
for the second <label>
- e.g.
input.switcher[type=checkbox]:checked + label ~ label {
color: green;
font-size: 70px;
}
Upvotes: 5