Squarespace CSS: Fixed Navigation Header on Scroll (Works For Mobile & Most Templates)

 

Sign up for a free Squarespace trial here! #afflink

Squarespace CSS - Fixed Header Navigation on Scroll - Mobile Brine all templates

This is a simple blog post, just to address a common Squarespace-related search term.

It seems a lot of people are wanting to know how to lock their navigation header in place as a user scrolls down through the site.

Usually, with scrolling, the header disappears from view, but there is value in keeping the header visible so that visitors always have access to your navigation menu.

Locking the header in place—which is usually called fixed navigation—is a technique with the user in mind. And good design is user-friendly design!

In Squarespace version 7.1, you can fix the navigation in the Style tab without using any CSS. However, if your site uses version 7.0, you’ll need to use a bit of Custom CSS.

Fortunately, my dear colleague Elise over at Websites by Elise was willing to help us all out by writing some Custom CSS which works across devices and for most templates! So without further ado, here’s how to fix the navigation header menu in place on your Squarespace website…


Custom CSS for Fixed (Sticky) Header Navigation on Squarespace Websites:

Works For Most Templates including Brine, and works across devices!

From the backend of your Squarespace site, navigate to the Custom CSS section (Design > Custom CSS), then paste the following code:

// fixed header navigation for desktop, tablet and mobile //
header, .Mobile {
 width: 100%;
 position: fixed;
 position: -webkit-sticky;
 position: sticky;
 top: 0;
 z-index: 1000;
}

if the background of your header navigation is transparent (rather than a solid color) OR if option #1 added too much padding to the top of your site, use the following CSS instead:

// fixed header navigation for desktop, tablet, and mobile //
header, .Mobile {
 width: 100%;
 position: fixed;
 top: 0;
 z-index: 1000;
}

Looking toward Port Townsend, WA from a ferry crossing the Strait of Juan de Fuca

Looking toward Port Townsend, WA from a ferry crossing the Strait of Juan de Fuca

Hopefully this worked for you. I know that personally the articles I found on this topic created a fixed navigation but it was wonky, for example: my blog posts would get stuck underneath the header. So the Custom CSS in many of those articles didn’t really work.

I’ve tried the above CSS on several websites, though, and so far it’s worked wonderfully! That’s because Elise knows what she’s doing :) Thanks Elise!!

Let us know if you have any questions or run into any difficulties! We’ll try to help out if we can!

Thanks for stopping by and I’ll talk to you again soon. Take care~

x
Tiffany

 
 

Welcome!

Tiffany D Davidson - Squarespace Web Designer - Squarespace SEO Expert - Best Squarespace Designers - Squarespace Expert.png

Hey there! I’m Tiffany ~ a Squarespace Web Designer & SEO Expert. I design beautiful & professional websites that rank well on Google, & I teach courses on becoming a Squarespace SEO Expert, Monetizing Squarespace, and Starting Your Own Squarespace Design Business!


Feel free to contact me at: tiffany@tiffany-davidson.com

Sign up for a free Squarespace trial here! #afflink


My Courses: