trying to create a Nav-drawer that opens when a checkbox is checked, all great but the opening part is where am stuck at
HTML
<div class="leftside">
<input type="checkbox" id="check" name="check">
<label for="check" class="checkbtn">
<i class="fas fa-bars icon navburger"></i>
</label>
</div>
<div class="nav-items">
...
</div>
CSS
.nav-items{
width: 100%;
height: 100vh;
position: fixed;
overflow: hidden;
left: -100%;
display: flex;
z-index: 10001;
background-color: #fff;
flex-direction: column;
transition: all .5s;
}
#check{
display: none;
}
#check:checked ~ .nav-items {
left: 0;
}
I believe that its a problem in the last css code of #check but i cant figure out why.