- This topic has 7 replies, 3 voices, and was last updated 2 years, 11 months ago by
Fernando.
-
AuthorPosts
-
April 3, 2023 at 11:02 am #2595122
Tim
Hello, I’d like to center the logo in the navigation but when I install the code found below it still isn’t working. When I change “navigation as header” it pops up to high in the margin
@media(min-width: 769px) {
.inside-header>.site-branding,
.inside-header>.navigation-branding,
.inside-header>.site-logo,
.site-branding-container,
#site-navigation .navigation-branding .site-logo,
#sticky-navigation .navigation-branding {
position: absolute;
left: 50%;
transform: translateX(-50%);
z-index: 1000;
}#site-navigation {
margin-left: unset !important;
display: flex;
}.site-header .main-navigation:not(#sticky-navigation) .inside-navigation {
margin: unset;
}#site-navigation,
#primary-menu,
.main-navigation .inside-navigation {
flex: 1;
}/* Change nth-child(#) to first item to right */
.main-navigation ul li:nth-child(3) {
margin-left: auto;
}
}April 3, 2023 at 11:09 am #2595135Ying
StaffCustomer SupportHi there,
When I change “navigation as header” it pops up to high in the margin
Not sure what you mean by to high in the margin, do you mean the position to close to the top edge?
If so, you can change this CSS:
.inside-header>.site-branding, .inside-header>.navigation-branding, .inside-header>.site-logo, .site-branding-container, #site-navigation .navigation-branding .site-logo, #sticky-navigation .navigation-branding { position: absolute; left: 50%; transform: translateX(-50%); z-index: 1000; }to this:
.inside-header>.site-branding, .inside-header>.navigation-branding, .inside-header>.site-logo, .site-branding-container, #site-navigation .navigation-branding .site-logo, #sticky-navigation .navigation-branding { position: absolute; left: 50%; transform: translateX(-50%); z-index: 1000; top:20px; }Feel free to adjust the
20pxvalue to adjust the vertical position of the logo.April 3, 2023 at 7:39 pm #2595529Tim
Thank you!
Now when I made those changes the right menu looks further spaced away from the logo than the left menu.
Also the menu items are not centered on the logo. Is there a way to adjust the menu items like we did the logo?
April 3, 2023 at 8:25 pm #2595544Fernando Customer Support
Try adding this for the vertical menu spacing:
div#primary-menu { margin-top: 20px; }Change the value to your liking.
As for the logo, it’s exactly at the center horizontally. It may just look nearer to one side because the menu items on that side is longer horizontally.
April 3, 2023 at 8:39 pm #2595554Tim
I tried adding that but no luck.
Sounds good on the menu centering.
April 3, 2023 at 9:01 pm #2595559Fernando Customer Support
Can you remove the extra
}at the very bottom of your Additional CSS? It’s causing a syntax error.The one after this:
/* Change nth-child(#) to first item to right */ .main-navigation ul li:nth-child(4) { margin-left: auto; }April 4, 2023 at 8:32 am #2596603Tim
Thank you!
April 4, 2023 at 5:05 pm #2597162Fernando Customer Support
You’re welcome, Tim!
-
AuthorPosts
- You must be logged in to reply to this topic.