Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Centered Nav Menu

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #25245
    ericmiller74
    Member

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

    and the example page is here : https://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

    #64915
    godwinsam
    Member

    hello,

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

    Thanks & Regards

    #64932
    Capt Otis
    Member

    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)
  • The forum ‘CSS’ is closed to new topics and replies.