Grow your CSS skills. Land your dream job.

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: http://css-tricks.com/navigation-markup-after-content/

    and the example page is here : http://css-tricks.com/examples/NavCodeAfterContent/

    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 ;)

    Thanks

    # October 1, 2009 at 2:31 am

    hello,

    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…

    Set

    Code:
    body {
    width=100%; }

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

    Code:
    #nameofdivID{
    margin:0 auto;
    }

    -T

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

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".