All Posts by Email, Once a Week

Media Temple logo

CSS-Tricks is brought to you in part by Media Temple, the web hosting that we both use and recommend.

Centered Nav Menu

  • # June 23, 2009 at 5:28 pm

    I am messing around with the files that Chris supplied for the Content before Nav tutorial and having a difficult time centering the menu items in the space.

    The tuturial is here:

    and the example page is here :

    I would like to have the nav menu items stay centered in a 100% width container. I have acheived this using positioning on the ul but when the font size changes it moves off center.

    Hopefully this is enough information to get started and the solution is easy ;)


    # October 1, 2009 at 2:31 am


    Please put the nav inside the
    <center></center> tag and check it.

    Thanks & Regards

    # October 1, 2009 at 9:04 am

    Thats not exactly css though…


    body {
    width=100%; }

    Have another div inside the body that wraps around everything you want centered. Then give that wrapper

    margin:0 auto;


Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed