Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Highlight label for radio buttons when selected with only CSS
input:checked + label {
color:red;
font-weight: bold;
}
<div>
<input id="radio-1" name="food" type="radio" value="broccoli">
<label for="radio-1">Broccoli</label>
<br />
<input id="radio-2" name="food" type="radio" value="burger">
<label for="radio-2">Burger</label>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.