Jump to content

Forcing Mobile Menu earlier on desktop

Go to solution Solved by tuanphan,

Recommended Posts

Hello,

I have built a website with split screen navigation, but I find if I make my desktop narrower at all the navigation items begin to stack/overlap. As a solution, I hoped to force mobile nav earlier than 787 px (1100 px).  It seems to be working, but when I do so, the logo is quite off centre (photo attached). Anyone know how to fix this?

Website: atelieroleana.squarespace.com

Password: ao

 

Code I am currently using:


@media screen and (max-width:1100px) {
 /* hide navigation */
    .header-nav {
    display: none;
}
/* Hide header button */
.header-actions {
    display: none;
}
/* show burger */
.header-burger {
  display: flex;
}
/* Show overlay mobile menu */
.header--menu-open .header-menu {
opacity: 1;
visibility: visible;
}
}

Screenshot 2024-05-19 at 7.10.05 AM.png

Link to comment
  • 2 weeks later...

Hi @tuanphan!

Thanks, this worked, but now the logo is centred on mobile but slightly off centred when it's on desktop but narrowed (See screenshots). Is there a fix for this?

 

Website: atelieroleana.squarespace.com

Password: ao

 

Screenshot 2024-05-30 at 2.30.23 PM.png

Screenshot 2024-05-30 at 2.30.32 PM.png

Link to comment
On 5/31/2024 at 4:11 AM, KatJarv said:

Hi @tuanphan!

Thanks, this worked, but now the logo is centred on mobile but slightly off centred when it's on desktop but narrowed (See screenshots). Is there a fix for this?

 

Website: atelieroleana.squarespace.com

Password: ao

 

Screenshot 2024-05-30 at 2.30.23 PM.png

Screenshot 2024-05-30 at 2.30.32 PM.png

Logo is fine to me

image.thumb.png.2fb039759e2d7200050cb5f6983432ab.png

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

@tuanphan

It looks find when the desktop is wide (like your screenshot above), and in mobile, but in between (around 1100px), it's off centred. See below screenshots. It's easier to see when you open the menu overlay.

 

 

Screenshot 2024-06-01 at 8.58.20 PM.png

Screenshot 2024-06-01 at 8.58.15 PM.png

Link to comment
On 5/21/2024 at 3:32 PM, tuanphan said:

You can use this CSS code under

@media screen and (max-width:1100px) {
.header-title-nav-wrapper {
    flex: 0 0 calc(~"100% - 50px") !important;
}
}

 

Try changing to this

@media screen and (max-width:1100px) {
.header-title-nav-wrapper {
    flex: 0 0 100% !important;
}
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.