How to Change the Header Style for One Page Only (Squarespace 7.1)

Want to be able to change the header color on a Squarespace page, but not the rest of your site? So, I’m going to run you through how you can do it with a simple little CSS hack. Perfect for adding visual interest, highlighting a sales page, or modifying a homepage look.

Why Change the Background Color of the Header for a Single Page?

By default, Squarespace uses one global header style across your site. But you want your header to be in your face in some cases (like on a:

  • Sales page or landing page

  • Portfolio section that is a real character.

  • Custom-branded promo page or event page

So instead of customizing the header per entire site, let’s add some CSS so that we can customize it on a single page.

Step-by-Step Instructions

Step 1: Find the Page’s Unique Identifier

Every page in Squarespace 7.1 has a data-page-id assigned to it. To find it:

  • Open your page in a browser (not within our site editor).

  • Right-click anywhere on the page > Inspect or View Page Source.

  • Search (Ctrl + F or Cmd + F) for data-page-id=.

  • Copy the ID ( something like data-page-id="5f879a0...").

Or you could use a Chrome extension such as Squarespace ID Finder to get the ID easily.

Step 2: Add Custom CSS

Now we’ll apply custom styles to the header only when viewing that specific page.

Go to Pages → Custom Code → Custom CSS, then paste the following code:

Copied!
//For Adaptive & Gradient Header
#YourPageCollectionsID .header {
  background: #AECBF1 !important;
}
//For Solid Header
#YourPageCollectionsID .header-background-solid {
  background-color: #AECBF1 !important;
} 
  • Replace "YOUR_PAGE_ID" with the actual ID you copied earlier.

  • You can change the background color to any HEX, RGB, or HSL color you like.

Example: Changing Header Color to White

Copied!
#YourPageCollectionsID .header {
  background: #ffffff !important;
}
//For Solid Header
#YourPageCollectionsID .header-background-solid {
  background-color: #ffffff !important;
} 

This will change the header background to white, but only on that page.

Bonus Tips

Want to change the header text color, too? Add this:

Copied!
#YourPageCollectionsID .header-nav-item a {
  color: #000000 !important;
}
  • Need to change the logo or hide elements? You can also target them with data-page-id just like this.

Final Thoughts

Creating a unique Squarespace header color for individual pages is an excellent way to make those pages stand out and add more personality to specific content. With this easy CSS trick, you can exercise more command without involving a developer.


Frequently Asked Questions

Walid Hasan

I'm a Professional Web developer and Certified Squarespace Expert. I have designed 1500+ Squarespace websites in the last 10 years for my clients all over the world with 100% satisfaction. I'm able to develop websites and custom modules with a high level of complexity.

If you need a website for your business, just reach out to me. We'll schedule a call to discuss this further :)

https://www.squareko.com/
Previous
Previous

How to Display Logo Left and Site Title Right in Squarespace 7.1

Next
Next

How to Change the Logo on Different Pages in Squarespace 7.1