WordPress.org

Support

Support » Themes and Templates » Fitting a menu to the width of the container.

Fitting a menu to the width of the container.

  • Can anyone tell me how i fit my pink navigation menu to the width of the page?
    I’m struggling…..

    Site’s here

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • sorry its not pink, its the beige one across the top.
    my bad.

    WPyogi

    @wpyogi

    Forum Moderator

    Ha – I was wondering about that! There may not be an easy, automatic way to do that — you’ll probably have to adjust the CSS if you add more menu items. Do you have custom CSS or a Child Theme set up?

    Yes i’m using custom css – i’ve been playing with it and i know it has something to do with margin: 0 auto; but just can’t figure which div to apply it to.

    WPyogi

    @wpyogi

    Forum Moderator

    I’m a bit confused about your theme – the link to the stylesheet says twentytwelve – but in the style.css file, it says it’s custom? (Just checking because if twentytwelve has been modified directly, all the changes will be lost when WP is updated.)

    WPyogi

    @wpyogi

    Forum Moderator

    Changing the text-align here seems to center the menu:

    .main-navigation ul.nav-menu, .main-navigation div.nav-menu > ul {
        display: inline-block !important;
        text-align: left;
        width: 100%;
    }

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Fitting a menu to the width of the container.’ is closed to new replies.