I’m trying to do a navbar with centered logo, but I can’t do it the right way.
html,
body {
height: 100%;
}
body {
margin: 0;
}
nav {
display: flex;
width: 100%;
height: 5%;
background: #eee;
align-items: center;
justify-content: center;
}
a {
text-decoration: none;
color: rgba(0, 0, 0, 0.8);
margin: 0 40px;
}
.circle {
height: 150px;
width: 150px;
background-color: #eee;
border-radius: 550%;
display: inline;
}
<nav>
<a href="">Menu</a>
<a href="">Menu</a>
<span class="circle"></span>
<a href="">Menu</a>
<a href="">Menu</a>
I was expecting something like this, which I did in Photoshop:
3
Answers
use
justify-content:space-between;
instead ofjustify-content:center;
and add two divs.demo: https://codepen.io/phong18/pen/KKPyzro
html:
add more css:
try with this code view in full page mode