Centering your navigation horizontally across your site isn’t as easy as it sounds. There are a number of solutions I’ve come across to achieve this and most of them do the trick. I wanted to share one solution for centering a navigation horizontally that I have found works well and requires the least amount of css code.
How to Center your Navigation Horizontally
The method I’m using come from this blog and you can read more detail about it there. I have adapted it to work with your Thesis theme. Paste this into your custom.css file:
.custom .menu {
text-align:center;
}
.custom .menu li {
display:inline;
float:none;
}
.custom .menu a {
display:inline-block;
}
I had to make one small tweak in order for it to work in Thesis. I added “float:none;” on line #7 because by default, the list items in the menu are floated to the left and that will cause the navigation to not center. You will also most likely add you own unique styling to the menu so it works with your design. This is simply the bare bones code to center it.
It would be cool if this feature was built directly into the next version of Thesis, so you can just check an option in the Navigation settings to center the menu.
- Centering List Items Horizontally (Slightly Trickier Than You Might Think)
- Create a centered horizontal navigation
- How to center your Thesis menu
Was this post helpful? Consider subscribing to my blog via RSS or







































{ 5 comments… read them below or add one }
Thanks dude!! I looked for a solution to this for ages! And yours was the easiest and best one!
Yes, I’d also searched for ways to do this and there are a few methods out there, but this one was the easiest to implement. Credit goes to Harry of csswizardry.com where I found this and then just adapted very slightly for Thesis.
Thank You, this really works!! I spent a lot of time trying to figure this out…
This is perfect! thanks!
Hrvoje Volarevic recently posted..Proba
Thanks for sharing, it worked perfectly.
lizzie – strayed from the table recently posted..Spicy Pumpkin Soup – Recipe
Hey, it worked great for me. Thanks!!!
Anchal Bhatia recently posted..Couple Spa Therapies to Spice up your Love Life