Jump to content

Help to change color of header on Search page?

Recommended Posts

Hello there,

 

If you go to my site: https://activestatedesigns.squarespace.com/search?q=sunset (password: SiteTest) the header SHOULD be blue (#2C4F6D) like it is on my other pages.  But it's white, so my White font in my logo is not seen.  How can I fix this for only Search page?  Each initial page (before scrolling) the header is invisible except when on hover.  It's blue at all other times.  

 

Thanks,

Lorne

Link to comment

Add to Settings > Advanced > Code Injection > Footer (DO NOT ADD TO DESIGN > CUSTOM CSS)

 <script>
if (document.location.pathname.indexOf("/search") == 0) {
    document.querySelector('body').classList.add('t-search')
}
  </script>
<style>
  .t-search header#header {
    background-color: #2C4F6D !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
On 2/3/2023 at 8:28 PM, Lorne17 said:

Thanks @tuanphan, super helpful.  Last question, how do I get the font and social icons to be white?  I tried adding color css to that style code and it didn't work?

Add this code under

<style>
  .t-search .header-nav-item a {
    color: white;
}
.t-search header#header svg {
    fill: white;
}
</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.