JSFiddle - React, Tailwind, and code Playground
HTML
<div class="container">
<input type="checkbox" id="burger-active">
<label for="burger-active" class="burger-button"></label>
<div class="menu">
<a href="">menu</a>
<a href="">menu</a>
<a href="">menu</a>
<a href="">menu</a>
<a href="">menu</a>
</div>
</div>
CSS
.container {
position: relative;
display: flex;
align-items: center;
max-width: 400px;
height: 50px;
background-color: #1354be;
}
.menu {
position: absolute;
width: 100%;
display: flex;
height: 100%;
justify-content: space-between;
}
a {
display: flex;
align-items: center;
justify-content: center;
flex-grow: 1;
height: 100%;
padding: 0 5px;
color: #fff;
text-decoration: none;
text-transform: uppercase;
background-color: #1354be;
}
a:hover {
background-color: #4381e5;
}
#burger-active {
display: none;
}
.burger-button {
display: none;
width: 20px;
height: 20px;
margin-left: 15px;
background-color: #fff;
}
@media screen and (max-width: 700px) {
.menu {
display: none;
}
a {
background-color: #296cd8;
}
.burger-button {
display: block;
}
#burger-active:checked ~ .menu {
display: block;
top: 100%;
}
}