This is your setup:
<ul id="nav"> <li><a href="#">item 1</a></li> <li><a href="#">item 2</a></li> </ul>
Your link will not populate the <li> , but the <li> will still be a block element. Make <li> display: inline :
ul#nav li {display: inline;}
Or float li and give it a width:
ul#nav {overflow: hidden;} ul#nav li {float: left; width: 50%;}
source share