How can I get the parent element by reference with their child element using pure css?
#checkbox{
width: 24px;
height: 24px;
vertical-align: middle;
}
#checkbox:checked (parentName){
color: red;
}
<label for="checkbox">
<input type="checkbox" id="checkbox" />
click me
</label>
I know we can simply use jQuery to find the parent of the child element. Something like this;-
$(this).parent().css({'color': 'red'});
Is there anyway to identify the parent selector using pure css selector?