I've got an unordered list with a few list items. I'm trying to decrease the spacing between the list items, but they won't get any closer than they already are. Anyone have any suggestions?
Here is the relevant code:
ul.mainNav {
float: right;
padding-right: 185px;
}
li.mainNavItem {
color: blueviolet;
text-align: center;
list-style: none;
display: inline-block;
background-color: #000000;
width: 130px;
line-height: 50px;
}
<ul class="mainNav">
<li class="mainNavItem">hi</li>
<li class="mainNavItem">hello</li>
<li class="mainNavItem">welcome</li>
<li class="mainNavItem">hallo</li>
</ul>
I've tried playing with the margins, but even at .01px, the list items wouldn't get closer together. I do want some space between them, albeit very little, so creating a bar wouldn't solve my problem either.
Thanks in advance for any suggestions!