I have this jsfiddle and you can see the nav items are align to the left. Is there a way to center these items regardless of nav items, because I will have one more nav item when the user logs in…any ideas
Here is my html
<div id="cssmenu">
<ul>
<li><a href="#"><span>Home</span></a></li>
<li class="has-sub "><a href="#"><span>Products</span></a>
<ul>
<li class="has-sub "><a href="#"><span>Product 1</span></a>
<ul>
<li><a href="#"><span>Sub Product</span></a></li>
<li><a href="#"><span>Sub Product</span></a></li>
</ul>
</li>
<li class="has-sub "><a href="#"><span>Product 2</span></a>
<ul>
<li><a href="#"><span>Sub Product</span></a></li>
<li><a href="#"><span>Sub Product</span></a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#"><span>About</span></a></li>
<li><a href="#"><span>Contact</span></a></li>
</ul>
</div>
If you want to make your and
liaredisplay:block(perhaps you want to give them same widths), you got the right idea withrelativepositioning, just add the following properties:If not, make your
lisimplydisplay:inlineremoving all the other stuff and simply doing: