I am trying to make a sliding hamburger menu, and I am unable to move the div to the left when the checkbox (icon) is checked. The HTML for the following:
<div class="nav">
<div class="container">
<img src="{{ asset('assets/images/user.jpg') }}">
<a href="#">Sameer Manek</a>
</div>
</div>
<div class="window">
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger"><i class="fa fa-bars"></i></label>
{% block main %}{% endblock %}
</div>
and the CSS:
.nav-trigger:checked + label {
left: 215px;
}
.nav-trigger:checked ~ .window {
background-color: transparent;
left: 200px;
box-shadow: 0 0 5px 5px rgba(0,0,0,0.5);
}
.nav-trigger + label, .window {
transition: left 0.2s;
}
The 1st and the last CSS are applied properly and the label moves to left from its current position, but the div .window
does not