- This topic has 9 replies, 3 voices, and was last updated 4 years, 10 months ago by
David.
-
AuthorPosts
-
July 17, 2021 at 12:56 pm #1859368
Scott
I’m trying to line up the main menu on either side with the content area and there is some extra padding. I do have some extra css that adds a tab effect but removing it doesn’t fill the same width as the what the content area is specified as which is 960px. Staging url added to the Private Information.
Screenshot. So how do I get the menu to be exactly the same width as the content ?
Thanks as always for the fantastic support!
July 17, 2021 at 1:07 pm #1859382Ying
StaffCustomer SupportHi Scott,
Try this CSS:
#primary-menu { width: 100%; } #primary-menu ul { width: 100%; display: flex; justify-content: space-between; }July 17, 2021 at 3:17 pm #1859427Scott
Ying;
Thank you so much for the quick response!
That’s wasn’t quite doing it.
If I set the primary-menu to 960px (the content width) instead of 100% it does work….but now the sub menu item layout is horizontal.
#primary-menu { width: 960px; } #primary-menu ul { width: 100%; display: flex; justify-content: space-between; }So how do I reset the css for the sub menu items ?
Again, thank you so much!
July 17, 2021 at 4:29 pm #1859445Ying
StaffCustomer SupportTry add this CSS as well:
#primary-menu > ul > li.menu-item-has-children > ul { display: flex; flex-direction: column; }July 18, 2021 at 8:25 am #1860057Scott
That stacks them vertically but the width is constrained to the main menu button width. Do I have to set the size in pixels or is there a way to use the customizer pixel value?
Thanks again for the fantastic support Ying !
July 18, 2021 at 10:55 am #1860166Ying
StaffCustomer SupportYou are welcome!
1. Change this CSS:
#primary-menu ul { width: 100%; display: flex; justify-content: space-between; }To this:
#primary-menu > ul { width: 100%; display: flex; justify-content: space-between; }2. Go to Customizing > Layout > Primary Navigation > Sub-Menu Width, adjust the value to find the best fit 🙂
July 18, 2021 at 11:52 am #1860232Scott
That works fantastically 🙂 🙂
And I’ll need to wrap all that menu specific css in a media query, correct?
July 18, 2021 at 3:44 pm #1860344David
StaffCustomer SupportHi there,
it may not be required, but if it is then:
@media(min-width: 768px) { /* add styles here */ }July 19, 2021 at 8:07 am #1861194Scott
Yep it was required.
Thank you so much for the, as always, phenomenal support Ying and David!
July 19, 2021 at 4:38 pm #1861761David
StaffCustomer SupportGlad we could be of help
-
AuthorPosts
- You must be logged in to reply to this topic.