I am trying to have equal spacing between four different li
elements, but I end up with this:
HTML:
<ul><li>Inbox</li></li><li>Drafts</li></li><li>Sent</li></li><li>Trash</li></ul>
CSS:
ul li {
width: 25%;
display: inline-block;
text-align: center;
}
I have tested the CSS and it is working as it should. I think the problem is that the li
's don't all have the same amount of letters, so you end up with some weird visual effects. My reason for believing this:
(Equal spacing)
Try this
My approach with this issue is to center the li on the ul since the ul will naturally be the same width than the parent.
Check out this JSFiddle to see it working.