The problem is that the ,,+,, selector only targets the next sibling of the element on the left side of the ,,+,, selector (in your case, your checkbox).
And because the label
is the next sibling of your checkbox, your code wont work.
All you have to do is replace positions of your div
and your checkbox
, so that the div
will come right after the checkbox (also, you have to put label before the checkbox, not after it).
Here is the fixed version, hope I helped you a little bit :)
https://codepen.io/Juka99/pen/vYXMoOY
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…