- This topic has 8 replies, 2 voices, and was last updated 4 years, 5 months ago by
David.
-
AuthorPosts
-
December 20, 2018 at 7:27 pm #762566
Bill
I am opening a new thread per your suggestions from https://generatepress.com/forums/topic/centre-align-hamburger-icon-on-mobile/#post-762512
I am having trouble centering the hamburger menu on mobile.
Here is the transcript from the other post questions that I asked:
I tried the CSS provided above. However, I can not center my hamburger menu. Are there some other tricks to do this?
TO clarify when I add mobile header > ON it pushes the hamburger menu to the left.
When I turn off the mobile header but add my Navigation logo (which is my website logo and that must be there) the logo then shows up in mobile however now it pushes the Hamburger menu to the right.
What can I do to have my Navigation Logo (which is the website logo) centered on mobile and have the hamburger menu centered either below the logo or above. Thanks
December 21, 2018 at 1:20 am #762688David
StaffCustomer SupportHi there,
try adding this CSS instead:
@media (max-width: 767px) { .inside-navigation { display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; } .site-logo { -webkit-box-flex: 1; -ms-flex: 1 0 100%; flex: 1 0 100%; } .site-logo img { margin-left: auto; margin-right: auto; } }
December 21, 2018 at 7:16 am #763034Bill
Wow, that did it thanks. A question there is massive space between the hamburger menu and the header logo, and there is massive space between each menu item. What is the CSS to adjust this as well? Should I start a new thread for this? Thanks again. Great service.
December 21, 2018 at 7:22 am #763044David
StaffCustomer SupportI am not seeing that code on the live site? Do you have any cache plugins that need clearing?
December 21, 2018 at 7:28 am #763048Bill
David,
I just found this code that worked:
/*CENTER MOBILE HEADER */
@media (max-width: 767px) {
.inside-navigation {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
}
.site-logo {
-webkit-box-flex: 1;
-ms-flex: 1 0 100%;
flex: 1 0 100%;
}
.site-logo img {
margin-left: auto;
margin-right: auto;
}
}However, now the menu is compressed next to one of the menu items in mobile. See: http://prntscr.com/lxywp7
December 21, 2018 at 7:29 am #763049Bill
I mean the menu is compressed next to ‘Hire Me’ once I press the hamburger menu. Thanks.
December 21, 2018 at 7:48 am #763063David
StaffCustomer SupportTry this CSS:
button.menu-toggle { flex: 1 0 100%; }
December 21, 2018 at 8:06 am #763075Bill
Thank you. That fixed everything. Happy holidays to you.
December 21, 2018 at 8:19 am #763088David
StaffCustomer SupportYou’re welcome and to you too!
-
AuthorPosts
- You must be logged in to reply to this topic.