I created special radio buttons that are square instead of round. I'd like the border to change around them when they are selected. It's defaulted to white, but I'd like it to change to black. I'm having trouble targeting the div with class "padder".
HTML
<div class='specialRadio'>
<div class='padder'><input class='red' type="radio" id="radio1" name="group"/><label class='' for="radio1"></label></div>
<div class='padder'><input class='blue' type="radio" id="radio2" name="group"/><label class='' for="radio2"></label></div>
<div class='padder'><input class='yellow' type="radio" id="radio3" name="group"/><label class='' for="radio3"></label></div>
</div>
CSS:
.specialRadio input[type="radio"]{
display:none;
}
.specialRadio input[type="radio"] + label
{
height: 16px;
width: 16px;
display:inline-block;
padding: 0 0 0 0px;
}
.padder{
display:inline-block;
padding: 2px;
margin:2px;
border: 1px solid white;
}
.red { background: red;}
.blue { background: blue;}
.yellow { background: yellow;}
This line is where I'm having problems:
.specialRadio input[type="radio"]:checked>div{ /*select all parent divs where radio button is checked*/
border:2px solid black;
}
I know I can do the following css code, but it targets the label's border, not the parent div.
.specialRadio input[type="radio"]:checked + label{
border:2px solid black;
}