I have a checkbox that I need when it's checked to show a div inside another element (not next to the checkbox it's inside a div that is next to it's parent)
<nav>
<div class='container'>
<label class="tog" for="toggle">☰</label>
<input type="checkbox" id="toggle"></input> //This is the checkbox
</div>
</nav>
<div class='container'>
<div class='select'> // This is the div that I want to select when checkbox is checked
</div>
</div>
I tried these selectors but didn't work:
#toggle:checked ~ .select{display:block}
#toggle:checked + .select{display:block}