I have following menu (the .logo
and .socials
are placed inside by JS) and I need to have .logo
always in the middle of page having other items equally wrapped around.
<ul class="menu">
<li><a href="/">Homepage</a></li>
<li><a href="/contact/">Contact</a></li>
<li><a href="/documentary/">Documentary</a></li>
<div class="logo"></div>
<li><a href="/stories/">Stories</a></li>
<li><a href="/weddings/">Weddings</a></li>
<div class="socials">
<a href="https://www.instagram.com"><i class="sprite-instagram">i</i></a>
<a href="https://www.facebook.com"><i class="sprite-email">f</i></a>
</div>
</ul>
Centering items using CSS, but I have no clue how to stick the .logo
in the middle:
.menu {
bottom: 0;
margin-left: auto;
margin-right: auto;
left: 0;
right: 0;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
width: 100%;
position: relative;
-ms-flex-pack: distribute;
justify-content: space-around;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
Here is the fiddle if you want to have a look: https://jsfiddle.net/kybernaut/134L25vc/1/