<nav>
<input type="checkbox" role="button" aria-label="Display the menu" aria-expanded="false" aria-controls="menu">
<ul id="menu">
<li><a href="/">Home</a></li>
<li><a href="/about">About</a></li>
<li><a href="/shop">Shop</a></li>
<li><a href="/contact">Contact</a></li>
</ul>
</nav>
<main>
<h1>Title</h1>
</main>
body {
display: grid;
grid-template-columns: auto 1fr;
gap: 20px;
margin: 0;
}
ul {
padding: 20px 0;
margin: 0;
min-height: 100vh;
min-width: 180px;
box-sizing: border-box;
display: flex;
flex-direction: column;
align-items: center;
list-style: none;
background: teal;
}
ul li a {
padding: 10px 20px;
display: block;
color: #fff;
text-decoration: none;
font-size: 20px;
font-weight: bold;
font-family: sans-serif;
}
ul li a:hover {
text-decoration: underline;
}
nav input {
display: none;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.