I have a few "div" 's inside a "nav":
<nav>
<div>A</div>
<div>B</div>
<div>C</div>
<div>D</div>
<div>E</div>
<div>F</div>
</nav>
I want to align div A,B,C,D at the top, but div E and F at the bottom:
This code works for the last item (F), but E floats exactly in the middle:
nav {
display: flex;
flex-direction: column;
align-items: flex-start;
& > div:nth-child(5),
& > div:nth-child(6) {
margin-top: auto;
}
}
How can I make div E stick with div F at the bottom (without extra wrapping div's inside the nav)?