This is the Live Demo of my header section, what can I do to fix the empty space between the logo and navigation menu?
I want both the image
and .nav
to come close towards each other, not one to lean towards the other so that the empty space outside both is the same.
.nav {
display: flex;
align-items: center;
justify-content: space-between;
margin: 10px 100px;
}
ul {
display: flex;
list-style: none;
}
ul li {
padding: 8px 12px;
}
.nav .logo {
width: 120px;
}
<div class="nav">
<img class="logo" src="https://santabanta.co.in/wp-content/uploads/2023/11/vbes-2-1.png" alt="">
<ul>
<li><a href="">Classes & Services</a></li>
<li><a href="">Pricing</a></li>
<li><a href="">Kids & Family</a></li>
<li><a href="">Workshop</a></li>
<li><a href="">Training</a></li>
</ul>
</div>
4
Answers
Remove the justify-content from the
nav
:As @abasahed pointed out
Here is the codepen link
https://codepen.io/zsaleem/pen/QWowGVg
To get the required result, the value of the margin property in the "nav" class CSS rule should be changed as follows:
Thanks.
just use
justify-content : space-around;
instead ofjustify-content : space-between;