WordPress.org

Ready to get started?Download WordPress

Forums

Trying to get nav menu to be fixed and centered (2 posts)

  1. neuronphaser
    Member
    Posted 2 years ago #

    I am currently working on the site at http://www.laurie-landry.com and trying to get the main navigation menu -- currently sitting on the far right-hand side, top corner -- to be centered, and also fixed, so that when someone scrolls down, the menu stays "stuck" to the top of their browser window.

    I've played with the CSS and have been able to make the nav stick to the left-hand side of the screen, but no amount of margin:0 auto; will help me get the thing centered! Any help would be appreciated.

    The full CSS I'm working with is below. The important section seems to be "#header_nav" but I wonder if I'm getting some issues because there's conflicting placement in the "#nav" portions of the CSS, or the "#header_left"?

    I'm a n00b, plz help!:

    CSS removed.. people can see it on your site directly, no need to post it - mod

  2. WPyogi
    Volunteer Moderator
    Posted 2 years ago #

    (For posting more than 10 lines of code, you need to use pastebin -- and any code posted must use the code buttons or backticks.)

    That said, you can do what you want by changing the CSS code (line 632) to:
    #header_nav {
    margin: 0 auto;
    position: fixed;
    width: 800px;
    }

    Beware that using fixed position can create other problems -- so you'll have to test things out.

Topic Closed

This topic has been closed to new replies.

About this Topic