I think the only way to do this with pure css is to set the checkbox as the direct sibling in the div:
#div-1 {display:none}
#checkbox:checked + #div-1 {display:block;}
<input id="checkbox" type="checkbox" checked>
<div id="div-1">
Here is the content.
</div>
Run codeHide resultuser1987162
source
share