Using CSS :checked for styling labels
-
Hi, I’m trying to style a radio label and use the checked selector to accomplish that: when the radio button is checked, a style is applied to its label.
I would need to add to the label html the “for” attribute like
<input type="radio" id="hey" name="test" value="yes"> <label for="hey">yes</label>so I can apply a CSS rule like the following:
input[type=radio]:checked + label{ font-weight: bold; }Is there a way to do that?
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
The topic ‘Using CSS :checked for styling labels’ is closed to new replies.