2

I want to style my CheckBox. I wrote these code :

<div class="check-box-input">
    <input type="checkbox">
</div>

& I want to apply a style to parent div when input checked, I wrote this code but It doesn't work :

.check-box-input input:checked ~ .check-box-input {
    background-image: url('../Images/CheckBox.png');
}

1 Answers1

1

there's no way in css to do this but instead you can use the css "+" selector which select element immediately after the selected element

check this link http://www.w3schools.com/cssref/sel_element_pluss.asp