Jump to content

Change page header background colour on Search page only

Go to solution Solved by tuanphan,

Recommended Posts

  • Replies 7
  • Views 318
  • Created
  • Last Reply

Top Posters In This Topic

  • Solution

Add to Settings > Advanced > Code Injection > Footer

  <script>
  if (document.location.pathname.indexOf("/search") == 0) {
    document.querySelector('body').classList.add('t-search')
}
</script>
<style>
  body.t-search:not(.header--menu-open) header#header img {
    filter: invert(1);
}
</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

Hello Tuan 🙂 I have Brine 7.0 and have made my bottom header dark green on all pages to accommodate my logo and navigation links. But on my built in search page bottom header is white and navigation links are black. I have tried all the codes I have seen you post and I can not get any of them to work? Can you please help me.

The bottom header color I would like it to show is #023C31. In my page design settings my navigation links are set as white, so I am unsure why they are showing black on built in search page? Thanks so much!

Built In Search Page .jpg

Example Other Pages.jpg

Link to comment
On 5/3/2023 at 10:29 PM, YarrowMedicinals said:

Hello Tuan 🙂 I have Brine 7.0 and have made my bottom header dark green on all pages to accommodate my logo and navigation links. But on my built in search page bottom header is white and navigation links are black. I have tried all the codes I have seen you post and I can not get any of them to work? Can you please help me.

The bottom header color I would like it to show is #023C31. In my page design settings my navigation links are set as white, so I am unsure why they are showing black on built in search page? Thanks so much!

Built In Search Page .jpg

Example Other Pages.jpg

Can you share link to this page? We can give code easier

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.