Jump to content

Change the logo colour for mobile hamburger menu - 7.1

Go to solution Solved by tuanphan,

Recommended Posts

I'm using a dynamic menu, which works for most of my pages, but with a couple of my pages (FAQs and Services), the first section is the same colour as my logo. I have managed to implement CSS to switch out the logo to a different colour for the affected pages. It works well, apart from with the hamburger menu on mobile. 

I have followed the instructions to replace the hamburger logo for affected pages, but it doesn't seem to be hiding the original logo properly, so I get two logos overlapping, giving a funny outline. Can someone help me by taking a look at the code and see what's going on?

Code has been implemented in the "Advanced" section of the specific page, and not the site-wide CSS panel.

Website: https://aspiring-dental.squarespace.com

Password: Aspiring-Dental-2023

 

 

<style> 
div.header-title-logo a {
content:url("https://static1.squarespace.com/static/64ae1056de93ab723f53c4f3/t/64c8726fe5dffc761d47c949/1690858095063/AspiringDental_Logo_RGB_Blue.png") !important;     
max-width: 300px;
}
 
// mobile menu //
/* hide current image */
body.header--menu-open .header-title-logo img {
    visibility: hidden;
}
  /* set new image on burger menu click */
  body.header--menu-open .header-title-logo a {
    background-image: url(https://static1.squarespace.com/static/64ae1056de93ab723f53c4f3/t/64c877652a73de35bf04a12a/1690859365906/AspiringDental_Logo_RGB_Cream.png);
    background-size: cover;
    background-repeat: no-repeat;
}
</style>

Screenshot 2023-08-01 at 4.42.48 PM.png

Screenshot 2023-08-01 at 4.42.58 PM.png

Screenshot 2023-08-01 at 4.43.51 PM.png

Link to comment
  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

  • Solution

To replace Logo, use this new shorter code

<style> 
body:not(.header--menu-open) header#header img {
content:url(https://static1.squarespace.com/static/64ae1056de93ab723f53c4f3/t/64c8726fe5dffc761d47c949/1690858095063/AspiringDental_Logo_RGB_Blue.png) !important;}
  body.header--menu-open header#header img {
    content: url(https://static1.squarespace.com/static/64ae1056de93ab723f53c4f3/t/64c877652a73de35bf04a12a/1690859365906/AspiringDental_Logo_RGB_Cream.png);}
</style>

 

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

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.