If you want to customize the layout, try adjusting the flex-grow
property within each div
based on the length of the text in the corresponding nav
item.
nav {
display: flex;
flex-direction: row;
align-items: stretch;
}
nav div {
background-color: grey;
color: white;
margin: 2px;
padding-top: 5px;
padding-bottom: 5px;
text-align: center;
}
#div1 {flex-grow: 7;}
#div2 {flex-grow: 5;}
#div3 {flex-grow: 9;}
#div4 {flex-grow: 6;}
#div5 {flex-grow: 4;}
<nav>
<div id="div1">Hello</div>
<div id="div2">World</div>
<div id="div3">Lorem Ipsum</div>
<div id="div4">Dolor Sit</div>
<div id="div5">Amet</div>
</nav>