Jump to content

Logo not Centered when hiding mobile navigation icon

Go to solution Solved by tuanphan,

Recommended Posts

Site URL: https://caipirinhala.com/

I implemented the following code to hid the mobile navigation bar but it moved the logo header to left justified instead of centered. Any code I can add to fix it?

@media screen and (max-width:767px) {
.header-display-desktop {
    display: flex !important;
}
.header-display-mobile {
    display: none !important;
}
.header-burger {
    display: none;
}
.header-title-nav-wrapper {
    flex: 1 0 100% !important;
}
.header-nav {
    display: flex !important;
    width: 70% !important;
    flex: 1 1 70% !important;
}
.header-title {
    flex: 1 0 30% !important;
}
}

Screen Shot 2022-10-03 at 11.12.08 AM.png

Link to comment
  • Replies 3
  • Views 345
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

3 minutes ago, alyssazack said:

.header-nav { display: flex !important; width: 70% !important; flex: 1 1 70% !important; }

.header-title { flex: 1 0 30% !important; }

This code is setting the .header-nav to 70% of the width, and this .header-title to 30%.

You want the header title to be 100% and Nav to be 0%.

Try this:

@media screen and (max-width:767px) {
.header-display-desktop {
    display: flex !important;
}
.header-display-mobile {
    display: none !important;
}
.header-burger {
    display: none;
}
.header-title-nav-wrapper {
    flex: 1 0 100% !important;
}
.header-nav {
    display: flex !important;
    width: 0% !important;
    flex: 1 1 0% !important;
}
.header-title {
    flex: 1 0 100% !important;
}
}

 

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 

  Did I help? Buy me a coffee?

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 

Link to comment
  • 1 month later...
  • Solution
On 11/22/2022 at 6:13 AM, alyssazack said:

Hi Ziggy, somehow just seeing this. The code you suggested did not work. Any other recommendations? 

Thanks!

Add this to Design > Custom CSS

@media screen and (max-width:767px) {
.header-title-nav-wrapper {
    flex-direction: column !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.