Jump to content

Change Header Color On Scroll

Go to solution Solved by tuanphan,

Recommended Posts

I am trying to find the correct CSS code to change the background color of my header from transparent to black only when I scroll. Has anyone had any success with adding CSS to accomplish this?

Link to comment
  • Replies 11
  • Views 5.4k
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...
  • 2 months later...
  • 6 months later...

Hi, I'm sorry if this question is stupid, I am completely confused by Squarespace's platform.

Where exactly do we put this code? I'm putting it in Page Settings/Advanced and it's not changing my site at all.

What I'm trying to desperately achieve is a different header/footer color for different pages/menu topics. So far I've learned this is only possible with a handful of templates on 7.0, but then you're stuck with that template AND Squarespace will charge me to go backward (so that's not a solution); and utterly impossible with the very flexible 7.1.

Can anyone help?

Link to comment

@CompletelyConfused

Please post the URL for the page where you installed the code on your site.

If your site is not public please set up a site-wide password, if you've not already done so.

Post the password here.

Adding a site-wide password is not a security breach. Please read the documentation at the link provided to understand how it works.

We can then take a look at your issue.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
On 2/21/2021 at 2:29 AM, CompletelyConfused said:

Hi, I'm sorry if this question is stupid, I am completely confused by Squarespace's platform.

Where exactly do we put this code? I'm putting it in Page Settings/Advanced and it's not changing my site at all.

What I'm trying to desperately achieve is a different header/footer color for different pages/menu topics. So far I've learned this is only possible with a handful of templates on 7.0, but then you're stuck with that template AND Squarespace will charge me to go backward (so that's not a solution); and utterly impossible with the very flexible 7.1.

Can anyone help?

Can you share site url? We can help easier

or try editing page where you want to change header color >> Add a Code Block (anywhere) > Paste this code

<style>
  .header-announcement-bar-wrapper {
    background: black !important;
}
</style>

 

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
  • 2 years later...
On 4/27/2023 at 10:46 PM, Javdesign said:

Can you replace the word black with a hex value? I tried it and t doesn't seem to do anything. Is there a way to customize the header background color change (other than black in this example)?

Use this

<style>
  .header-announcement-bar-wrapper {
    background: #000 !important;
}
</style>

or

<style>
  .header-announcement-bar-wrapper {
    background: rgb(0,0,0) !important;
}
</style>

 

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.