I've exhausted all my options trying to center the navigation menu, but I just can't seem to get it right. I've experimented with text-align, margin-auto, block display... on both the parent and child elements. It's frustratingly simple, yet I can't crack it and it's starting to take a toll on my hair.
Check out the demo here.
If you want to take a look at the code, here's the HTML:
<div id="navigation" class="col-full">
<ul id="main-nav" class="nav fl">
<li id="menu-item-266" class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-home menu-item-266"><a href="http://previews.tinygiantstudios.co.uk/">Home</a></li>
<li id="menu-item-29" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-29"><a href="http://previews.tinygiantstudios.co.uk/about-us/">About Us</a></li>
<li id="menu-item-38" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-38"><a href="http://previews.tinygiantstudios.co.uk/news/">News</a></li>
<li id="menu-item-28" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-28"><a href="http://previews.tinygiantstudios.co.uk/contact/">Contact</a></li>
</ul>
</div><!-- /#navigation -->
And the CSS
#navigation {
margin-bottom: 0px;
background-color: #131313;
border-top: 0px solid #DBDBDB;
border-bottom: 0px solid #DBDBDB;
border-left: 0px solid #DBDBDB;
border-right: 0px solid #DBDBDB;
border-radius: 0px;
-moz-border-radius: 0px;
-webkit-border-radius: 0px;
font: 14px/14px sans-serif;
padding: 10px 0;
}
.nav {
z-index: 99;
margin: 0;
padding: 0;
list-style: none;
line-height: 1;
margin-left: 10px;
}
.fl {
float: left;
}
.nav li {
float: left;
width: auto;
}
Can someone lend a hand and point out what I'm overlooking?
Thank you,