Jump to content

Custom header button not showing on mobile menu

Go to solution Solved by JayVanDyke,

Recommended Posts

Hi there,

I created a custom header menu button so it has an image in instead of text. Issue is, on the mobile menu, the button is blank. Can't work out why or find a solution. Any help much appreciated!

Current code I'm using is:

 

 

.header-actions-action .btn {
    background-color: transparent !important;
    background-image: url(https://images.squarespace-cdn.com/content/655760ca5ce91354ff938b5a/71a5c7bc-6aac-454f-979c-b857c95f03f1/Discover+CLUB.png);
    background-size: contain !important;
    background-position: center;
    background-repeat: no-repeat !important
}

 

 

Site: https://mustard-bird-7p9h.squarespace.com/
Password is: FG123

Thanks!

Link to comment

@FGFGFG try using this selector for the mobile one. replace your code with this to target both at the same time.

.header-menu-cta, .header-actions-action {
  .btn {
    background-color: transparent !important;
    background-image: url(https://images.squarespace-cdn.com/content/655760ca5ce91354ff938b5a/71a5c7bc-6aac-454f-979c-b857c95f03f1/Discover+CLUB.png);
    background-size: contain !important;
    background-position: center;
    background-repeat: no-repeat !important
  }
}

 

Edited by jaeveedee
added a user tag

  Did I help you? Buy me a coffee!

👨‍💻 Bergen Design Co.

💻  I'm for hire on Upwork!

🕸️ Squarespace Experts  

🖥️ 99Designs

Link to comment
17 minutes ago, jaeveedee said:

@FGFGFG try using this selector for the mobile one. replace your code with this to target both at the same time.

.header-menu-cta, .header-actions-action {
  .btn {
    background-color: transparent !important;
    background-image: url(https://images.squarespace-cdn.com/content/655760ca5ce91354ff938b5a/71a5c7bc-6aac-454f-979c-b857c95f03f1/Discover+CLUB.png);
    background-size: contain !important;
    background-position: center;
    background-repeat: no-repeat !important
  }
}

 

 

Thanks for your reply. It disappears completely on the mobile menu with this code.

Link to comment
  • Solution
.header-menu .header-menu-cta, .header-actions-action {
  a.btn {
    background-color: transparent !important;
    background-image: url(https://images.squarespace-cdn.com/content/655760ca5ce91354ff938b5a/71a5c7bc-6aac-454f-979c-b857c95f03f1/Discover+CLUB.png) !important;
    background-size: contain !important;
    background-position: center;
    background-repeat: no-repeat !important
  }
}

Try and replace with this. Added some more specificity and there was something overriding your background-image part so added !important to that.

  Did I help you? Buy me a coffee!

👨‍💻 Bergen Design Co.

💻  I'm for hire on Upwork!

🕸️ Squarespace Experts  

🖥️ 99Designs

Link to comment
13 hours ago, jaeveedee said:
.header-menu .header-menu-cta, .header-actions-action {
  a.btn {
    background-color: transparent !important;
    background-image: url(https://images.squarespace-cdn.com/content/655760ca5ce91354ff938b5a/71a5c7bc-6aac-454f-979c-b857c95f03f1/Discover+CLUB.png) !important;
    background-size: contain !important;
    background-position: center;
    background-repeat: no-repeat !important
  }
}

Try and replace with this. Added some more specificity and there was something overriding your background-image part so added !important to that.

I think this has worked, 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.