Archived topic
Navigation menu with primary menu in the middle and nav button to the right
9 replies · Started by karenh on February 23, 2022
Hello,
I looked through the support documents and I'm trying to accomplish this with layout with the primary menu items in the middle and the call to action nav button to the right. Also, I would like this to stay the same with the sticky menu enabled. How can I accomplish this? Thank you.
Hi there,
do you have a site setup that i can see?
Hi David,
Yes, here you go
Thanks
Hi karenh,
Try this CSS:
nav#site-navigation {
flex: 1;
}
nav#site-navigation > .inside-navigation > #primary-menu > ul {
justify-content: space-between;
}
nav#site-navigation > .inside-navigation > #primary-menu {
width: 100%;
}
nav#site-navigation > .inside-navigation > #primary-menu > ul > li:last-child, nav#site-navigation > .inside-navigation > #primary-menu> ul > li:first-child {
margin-left: auto;
}
Thank you!
No problem :)
Hi Ying,
Is there a way to keep it consistent when the sticky menu is enabled? Right now when you scroll the page it all aligns right.
https://themaydev.wpengine.com/
Thank you
Try add this CSS as well:
@media (min-width: 769px) {
nav#sticky-navigation > .inside-navigation > #primary-menu > ul > li:last-child, nav#sticky-navigation > .inside-navigation > #primary-menu> ul > li:first-child {
margin-left: auto;
}
nav#sticky-navigation div#primary-menu {
flex: 1;
}
}
Let me know :)
Perfect! Thank you!
You are welcome!