*edited for being unclear - I'm trying to get the nav element to grow, but not too much, and to have the nav items space evenly.
When I create a header, I often use an empty div in order to help horizontal alignment when resizing, by assigning it a flex-grow weight.
I'm sure this is not the way it should be done, and it's probably just a lack of flexbox knowledge, so I was hoping someone could take a look at my header and recommend the proper way of doing it.
Here's the sort of resizing I want to achieve: https://codepen.io/anon/pen/LmVrvm
Thanks
<div class="container">
<div class="item logo">LOGO</div>
<div class="item empty-item"></div>
<div class="item nav">
<div class="item item1">MENU ITEM 1</div>
<div class=" item item2">MENU ITEM 2</div>
<div class="item item3">MENU ITEM 3</div>
</div>
</div>
-
.container{
display: flex;
width: 100%;
height: 70px;
background: #5e5e5e;
align-items: center;
}
.logo{
width: 200px;
text-align: center;
}
.empty-item{
flex-grow: 2;
}
.nav{
flex-grow: 1;
display: flex;
justify-content: space-between;
}
.item{
margin: 5px;
padding: 5px;
border: 1px solid #fff;
}