Site logo

Archived topic

Header/Main Nav Side Spacing

9 replies · Started by Brent Wilson on April 12, 2022

Viewing posts 1–10 of 10

Hi Brent,

With your current structure, here is a CSS you may try adding to Appearance > Customize > Additional CSS:

ul.menu li.menu-item a {
    padding: 0 20px;
}

@media (max-width: 1024px) {
    /* CSS in here for tablet only */
    .main-navigation .inside-navigation.grid-container>* {
    margin-left:0 !important;
    margin-right:0 !important;
    padding-left:0 !important;
    padding-right:0 !important;
}

.main-navigation > .inside-navigation.grid-container {
    padding-left:30px !important;
    padding-right:30px !important; 
}

.navigation-branding p.main-title {
    margin-left:0;
}
}

Hope this helps! Kindly let us know how it goes. :)

Hi Brent,

Try this CSS instead:

ul.menu li.menu-item a {
    padding: 0 20px;
}

@media (max-width: 1024px) {
    .main-navigation .inside-navigation.grid-container>* {
        margin-left:0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .main-navigation > .inside-navigation.grid-container {
        padding-left: 30px !important;
        padding-right: 30px !important;
    }

    .navigation-branding p.main-title {
        margin-left: 0;
    }

    ul.menu li.menu-item a {
        padding: 0;
    }

    ul.menu li.menu-item {
        padding: 0 30px;
    }
    .both-sticky-menu .main-navigation:not(#mobile-header).toggled .main-nav > ul {
    z-index: 10000;
}

}

I added a z-index value in the new code. The flickering issue was occurring because you have link elements in your body with a z-index of 999, similar to the z-index of the main-menu. Basically, they are on the same plane, causing the issue. I increased the z-index of your main-menu to avoid this issue.

Hope this clarifies. :)

That seems to work well.

Just a bit more to get this menu stuff all perfected!

On this page, I have an element applying CSS to change the color of the menu and such: https://wordpress-483838-2431328.cloudwaysapps.com/camp-meetings/2021-camp-meeting/

The following CSS is there to make the hover color change on the hamburger menu icon. But I have added the word "MENU" as a mobile menu label, and it is not changing to the hover color on hover. How do I include that?

.menu-toggle:hover .gp-icon svg {
    fill: #e7e7e7;
}

Try this:

button.menu-toggle:hover .icon-menu-bars > * {
    fill: rgb(255,0,0);
}

Kindly let us know how it goes. :)

That seems to be targeting the hamburger menu icon. But the CSS I sent you in my previous comment was already doing that. But it is still not targeting the mobile menu label.

Sorry, I misunderstood.

Try this if you want to modify the color of “MENU”:

button.menu-toggle span.mobile-menu {
    color:rgb(255,0,0);
}

Kindly let us know how it goes. :)

Okay, I was able to add hover to that, change the color, and achieve what I was trying to achieve. Thanks!

Oh yeah, sorry, I forgot about the hover. Glad you sorted it out though! Feel free to reach out anytime you’ll need assistance with anything else. :)

This archived topic is closed to new replies.