Site logo

Archived topic

Align mobile menu items

18 replies · Started by Shawn on December 6, 2018

Viewing posts 1–15 of 19

Hi,
I want the nav menu items to be aligned in the middle of the screen on mobile (especially on a phone). I'd like X MENU to be centered and the individual page names flush left to it.

The url isn't showing despite clicking on link. If you view the site on a phone, you'll see what I'm referring to.

Thanks.

Hi there,

If I understand this correctly, it might be easier to use the site header on mobile.

Can you try replacing this CSS:

.site-header {
    display: none;
}

with this:

@media (min-width: 769px) {
    .site-header {
        display: none;
    }
}

Hi Leo,

The code you suggested doesn't fix the alignment--I cleared browser cache on Chrome & Firefox but it appears the same as before.

Regards,
Shawn

I can but now I have two logos, as one was added about a month ago using instructions I received from GP tech support. The logo I added via Site Identity doesn't center on mobile, which I want it to do.

The logo added in Site Identity should be center by default and looks like it is.

Add this CSS to hide the navigation logo on mobile:

@media (max-width: 768px) {
    .site-logo.navigation-logo {
        display: none;
    }
}

Then we should just need a bit more CSS to center the toggle.

Let me know :)

Thanks.

Added the code, now just one logo is displaying. There's a large amount of white space between the logo and the X MENU text. X MENU appears slightly to the right instead of being centered horizontally in the phone screen. The pages text below X MENU are too far to the left of X MENU.

Reduce the header padding here: https://docs.generatepress.com/article/header-padding/

Then add this CSS:

@media (max-width: 768px) {
    .menu-logo .main-navigation:not(.mobile-header-navigation) .menu-toggle {
        float: none;
    }
    .inside-navigation {
        text-align: center;
    }
}

Reduce heading padding but still a lot of space between logo and X MENU. I need to enlarge the logo for mobile view so I'll leave spacing alone for now.

The X MENU isn't centered horizontally left to right. If you go to the ABOUT page, you'll see what I'm referring to.

Thanks.

Thanks Leo.

The logo is an svg file and is cropped tightly already.

Regards,
Shawn

I'm going to enlarge it as it's a little small on mobile.

Regards,
Shawn

Awesome. Let me know if you need another look :)

This archived topic is closed to new replies.