input:checked {
height: 20px;
width: 20px;
background-color: red;
}
input:not(:checked) + label {
opacity: 0.7;
}
<html>
<body>
<form action="">
<input type="radio" checked="checked" value="male" name="gender"> <label>Male</label><br>
<input type="radio" value="female" name="gender"> <label>Female</label><br>
<input type="checkbox" checked="checked" value="Bike"> <label>I have a bike</label><br>
<input type="checkbox" value="Car"> <label>I have a car </label>
</form>
Here i have set of radio and checkbox inputs and i am trying to change the background color of the checked
input. I'm able to alter the height and width of the element but not the background-color
of the inputs.
Where am doing wrong?