I have a radio where the options change from grey to black when the user hovers over them. But I want the checked option to remain black, even after the user is no longer hovering over it. I can't get it to do this at all.
label {
color: grey;
}
label:hover {
cursor: pointer;
color: black;
}
input[type="radio"] {
display: none;
}
input[type="radio"]:checked+label {
color: black;
}
<div star-buttons>
<label><input class="star-buttons" type="radio" name="radio" value="1"> ☆ <br></label>
<label><input class="star-buttons" type="radio" name="radio" value="2"> ☆ ☆<br></label>
<label><input class="star-buttons" type="radio" name="radio" value="3"> ☆ ☆ ☆<br></label>
<label><input class="star-buttons" type="radio" name="radio" value="4"> ☆ ☆ ☆ ☆<br></label>
<label><input class="star-buttons" type="radio" name="radio" value="5"> ☆ ☆ ☆ ☆ ☆<br></label>
</div>
I was trying to do something like in the last line of my CSS, but that's not working. How do I get this done?