I am trying to create a flexbox layout that resembles this:
I would like to space the first 3 items equally on the first line, with the 2 additional items spanning 100% of the next two respective lines.
Here is the HTML:
<header>
<nav class="navbar">
<a href="#" class="navbar-button">
<span class="bar"></span>
<span class="bar"></span>
<span class="bar"></span>
</a>
<div class="links products">
<a href="#">AUTOGRAPHS</a>
<a href="#">CARDS</a>
</div>
<div class="title">
<a href="index.html">YARDSALE SPORTS</a>
</div>
<div class="links cart">
<a href="#">CART (0)</a>
</div>
<div class="links navbar-menu">
<ul>
<li><a href="#">AUTOGRAPHS</a></li>
<li><a href="#">CARDS</a></li>
</ul>
</div>
</nav>
</header>
The navbar currently looks like this:
But I would like to make it look like this:
With the hamburger button, the title, and the cart taking up the first line, then autographs / cards taking up an entire line to themselves, respectively
I have already tried:
.navbar:nth-child(-n + 3) {
width: 33%;
}
and
.navbar:nth-child(n + 4) {
width: 100%;
}