I have a menu (ul
tags) whose elements are inline. Right now, the elements wrap when they reach the width of the container:
This is what I would like is to force the menu to be on two lines:
If extra entries are added, I would like the menu to equally divide on the two lines:
I'm ideally looking for a way to do it with css only. I tried using flexbox
and writing-direction
without succes. I'm open to a javascript solution but would like to have soft enought solution to allow for different designs in other responsive modes.
Edit:
Here is my HTML:
<ul class="main-menu">
<li class="main-menu__entry"><a href="#">Le projet</a></li>
<li class="main-menu__entry"><a href="#">Les numéros</a></li>
<li class="main-menu__entry"><a href="#">Obtenir le magazine</a></li>
<li class="main-menu__entry"><a href="#">Devenir coopérateur</a></li>
<li class="main-menu__entry"><a href="#">Nous contacter</a></li>
<li class="main-menu__entry"><a href="#">Proposer un sujet</a></li>
</ul>
and CSS (I simplified wit honly the relevant code)
.main-menu__entry {
display: inline-block;
padding: 4px 8px;
border: 2px solid gold;
margin: 0 2px 2px 0;
color: black;
}
Thanks.