- This topic has 19 replies, 4 voices, and was last updated 4 years, 3 months ago by
David.
-
AuthorPosts
-
December 8, 2018 at 8:51 am #751527
Zoran
Hi
I’m trying to achieve this layout on mobile: https://www.betreuungmitherz.ch/ but I’ve had little luck!
Also, I’ve noticed that when I resize the screen the menu breaks into multiple rows. How do I stop it from doing that? I want it to remain in one row (below the logo if there is no space)?
December 8, 2018 at 9:10 am #751538Leo
StaffCustomer SupportHi there,
1. That would be the default layout of our mobile header option:
https://docs.generatepress.com/article/mobile-header/2. You will need to increase the mobile header breakpoint so that it changes to a toggle before it breaks into 2 lines:
https://gist.github.com/generatepress/282078076cd8631c17717d5b8640c043Let me know if this helps π
December 9, 2018 at 3:03 am #751895Zoran
Hi,
1. doesn’t seem to be working (perhaps because I did these other steps you told me when styling the desktop menu : https://generatepress.com/forums/topic/styling-navigation-menu/)
2. Is there a way for the navigation to go below the navigation logo before it breaks into 2 lines?
December 9, 2018 at 9:36 am #752174Tom
Lead DeveloperLead DeveloperYou can use our Navigation Drop Point to achieve that: https://docs.generatepress.com/article/navigation-drop-point/
Let me know if it helps π
December 9, 2018 at 10:04 am #752189Zoran
Hi Tom,
I cannot use the float option as the current configuration has the header as hidden and the navigation is Below header (I linked it in my previous post).
December 9, 2018 at 2:43 pm #752316Tom
Lead DeveloperLead DeveloperAh, sorry about that!
Try this:
@media (max-width: 1200px) { .main-navigation .navigation-logo { float: none; margin: 0 auto; } .main-navigation .navigation-logo img { margin: 0 auto; } .nav-aligned-right .main-navigation { text-align: center; } }
December 10, 2018 at 3:21 am #752673Zoran
Hi,
This works like a charm (just set the max-width query to 1460px), thank you!
I’m still left with the mobile menu being centered below the logo
I have tried the mobile header idea and it did not work.
December 10, 2018 at 8:02 am #752937Tom
Lead DeveloperLead DeveloperWhat about it didn’t work exactly? The mobile header is the best way to get the mobile toggle to the right of the logo.
December 10, 2018 at 8:14 am #752943Zoran
Activating it doesn’t really change much. It’s still below the logo.
December 10, 2018 at 9:05 am #753014Tom
Lead DeveloperLead DeveloperYour logo is too wide for it to fit.
You can try adding something like this:
.mobile-header-logo img { width: 50%; }
December 10, 2018 at 11:56 pm #753472Zoran
It doesn’t work. There’s a margin on the image that I can’t get rid of for some reason.
December 11, 2018 at 2:35 pm #754169Tom
Lead DeveloperLead DeveloperIt’s hard for me to tell what’s going on without being able to inspect the code myself. Any chance you can save the mobile header option so I can take a look? You can remove that CSS for now.
December 12, 2018 at 12:45 am #754376Zoran
Hi, yes, sorry, I’ve enabled the mobile header now.
December 12, 2018 at 10:41 am #754910Tom
Lead DeveloperLead DeveloperSo that’s happening because of this custom CSS:
@media (max-width: 768px) { .menu-toggle { margin-left: 25%; margin-right: 37%; } }
If you remove that, it should work.
Let me know π
December 12, 2018 at 11:52 am #754948Zoran
Hi Tom,
Removing that CSS didn’t help (I tried it before, too, it is removed now).
-
AuthorPosts
- You must be logged in to reply to this topic.