Is there a way to align all items in a navbar except for one to the left, with a fixed combined minimum and maximum width of 300px-400px, while sending the last item to the right margin?
I want the final result to resemble this:
https://i.stack.imgur.com/z10Lj.gif
Currently, I have four items structured in HTML and CSS like so:
HTML
<div id="nav">
<ul>
<li><a href="/">One</a></li>
<li><a href="/">Two</a></li>
<li><a href="/">Three</a></li>
<li><a href="/">Four</a></li>
</ul>
</div>
CSS
#nav span {
display: inline-block;
position: relative;
}
#nav ul {
text-align: justify;
max-width: 400px;
}
#nav ul:after {
margin-left: 100%;
content: "";
}
#nav ul li {
display: inline;
}
I am currently using a technique mentioned in this question's accepted answer to justify the elements within a 400px maximum width. However, I now need to exclude the fourth element from this justification and move it to the right side.