If you have spaces between you <li> elements, remove this and no more weird space in the user interface. The return that you have causes this.
I created http://jsfiddle.net/59sTg/1/ to show you that it works without spaces.
This is ultimately the result of the display:inline-block; attribute display:inline-block; . One of many ways to solve this issue (besides simply removing the space / return, use float:left instead of display:inline-block . Alternatively, if you want to keep it exactly as it happens, sometimes using comments can help with formatting
<li>someLink</li><li>secondLink</li>
edit : I updated jsfiddle to include both methods (the latter shows you how to swim using a class called myfloatedelement , although I would recommend a bit of CSS / classes rebuild, I did it pretty fast and dirty)
<nav id="menu" class="myfloatedelement"> <ul> <li><a ref="#">First</a></li> <li><a href="#">Second</a></li> <li><a href="#">Third</a></li> </ul> </nav>
-
.myfloatedelement{ overflow:auto; } .myfloatedelement ul{ float:right; overflow:auto; } .myfloatedelement ul li{ float:left; }
source share