Is it possible to make the hamburger icon push down the content, including the background and text, when clicked? I've attempted to adjust padding on the body and set the width of the hamburger icon, but so far it hasn't been successful. I've spent the last few hours trying to get it right. Ideally, I'd like to achieve this using just CSS.
.mobile-nav {
position: fixed;
top: 0;
right: 0;
text-align: right;
padding: 10px;
background: var(--bg-color);
width: 100vw;
z-index: 2;
}
.mobile-nav .menu {
display: flex;
text-align: center;
justify-content: center;
display: none;
}
.mobile-nav .menu ul li {
list-style: none;
padding: 0.1rem;
font-size: 1.2rem;
}
.mobile-nav #toggle {
display: none;
cursor: pointer;
}
.mobile-nav #toggle:checked + .menu {
display: flex;
}
<div class="mobile-nav">
<label for="toggle"><i class="fas fa-bars fa-2x"></i></label>
<input type="checkbox" id="toggle">
<div class="menu">
<ul>
<li><a href="#home">HOME</a></li>
<li><a href="#promise">OUR PROMISE</a></li>
<li><a href="#team">TEAM</a></li>
<li><a href="#sponsors">SPONSORSHIPS</a></li>
<li><a href="#about">ABOUT</a></li>
<li><a href="#contact">CONTACT</a></li>
</ul>
</div>
</div>