I am trying to achieve equal spacing between list items, and I attempted the following code.
ul {
list-style-type: none;
display: flex;
justify-content: space-between;
}
However, it seems that this approach is not working as expected. I am confused about why?
PS: Interestingly, using gap: 10px
(with 'px' being an example) works instead, adding a gap between the list items. Shouldn't justify-content: space-between;
provide the same result?
EDIT: Provided below is the relevant HTML:-
<div class="left-links">
<ul>
<li><a href="#">ONE</a></li>
<li><a href="#">TWO</a></li>
<li><a href="#">THREE</a></li>
</ul>
</div>
<div class="logo">LOGO</div>
<div class="right-links">
<ul>
<li><a href="#">FOUR</a></li>
<li><a href="#">FIVE</a></li>
<li><a href="#">SIX</a></li>
</ul>
</div>
1: The current output when using justify-content: space-between;
:
2: The desired outcome (achieved with gap: 10px;
):