Site logo

[Resolved] make menu navigation at the center on float right nav location

Home Forums Support [Resolved] make menu navigation at the center on float right nav location

Home Forums Support make menu navigation at the center on float right nav location

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #2484146
    Willya

    Hi,

    I would like to center my navigation menu, while the logo remains on the left and the button remains on the right.

    I have follow there tutorial but not work for my case after I set sticky navigation:
    https://generatepress.com/forums/topic/center-main-nav-on-page/
    https://generatepress.com/forums/topic/how-to-make-navigation-menu-on-center-and-button-on-navigation-is-on-the-right/

    #2484174
    Fernando
    Customer Support

    Hi Willya,

    Can you try adding this through Appearance > Customize > Additional CSS?:

    header.site-header .inside-header nav:not(.mobile-menu-control-wrapper) {
        flex-grow: 1;
    }
    
    header.site-header .inside-header div#primary-menu {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
    
    header.site-header .inside-header .inside-navigation {
        position: static;
    }
    
    header.site-header .inside-header .inside-navigation .menu-bar-items {
        margin-left: auto;
    }
    #2484181
    Willya

    Hi Fernando,

    Thank you for your help. The CSS code you provide is work!

    Ah, I notice that my sticky navigation is hidden when I scroll the page to the section of dark background (perhaps because I set the container outer index to 99). How to make fix it?

    #2484183
    Fernando
    Customer Support

    Do you need it at a z-index of 99? If not, you can revert it to 1. That should resolve the issue.

    #2484242
    Willya

    Yes, I revert it to 1 and that resolved the issue. Thanks again!

    #2484244
    Fernando
    Customer Support

    You’re welcome, Willya!

    #2484259
    Willya

    Fernando, I forgot something. I see that in other pages, the main navigation is not on the center. its is center, but only on homepage. Is it because I use transparent header on homepage so that the CSS class/ID on other pages perhaps different so that the code not works?

    #2484268
    Fernando
    Customer Support

    Yes, my code is intended for the structure of the homepage only.

    I updated the code I provided above now. Can you try that instead?

    That should work for all pages I believe.

    #2484274
    Willya

    Wow! Glad to be part of the GP family : )
    You are my favorite support, Fernando.

    #2484286
    Fernando
    Customer Support

    You’re welcome, Willya! 🙂

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.