I want to create the next logic: when i will check the checkbox to apply a background for another element. I want to do this using only css.
div{
border:1px solid red
}
input:checked .parent {
background:red;
}
<div class="parent">
<label for="">Text</label>
<input type='checkbox'>
</div>
So i want to apply a background for .parent
when i check the checkbox, but this doesn't work. Who knows how to solve this?