- This topic has 9 replies, 2 voices, and was last updated 3 years, 3 months ago by
Fernando.
-
AuthorPosts
-
January 4, 2023 at 9:03 pm #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/January 4, 2023 at 9:45 pm #2484174Fernando 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; }January 4, 2023 at 10:02 pm #2484181Willya
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?
January 4, 2023 at 10:12 pm #2484183Fernando Customer Support
Do you need it at a z-index of
99? If not, you can revert it to1. That should resolve the issue.January 4, 2023 at 11:48 pm #2484242Willya
Yes, I revert it to 1 and that resolved the issue. Thanks again!
January 4, 2023 at 11:54 pm #2484244Fernando Customer Support
You’re welcome, Willya!
January 5, 2023 at 12:10 am #2484259Willya
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?
January 5, 2023 at 12:19 am #2484268Fernando 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.
January 5, 2023 at 12:25 am #2484274Willya
Wow! Glad to be part of the GP family : )
You are my favorite support, Fernando.January 5, 2023 at 12:41 am #2484286Fernando Customer Support
You’re welcome, Willya! 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.