BryanMinton Posted September 30, 2022 Share Posted September 30, 2022 Hi, I have applied a portfolio page which is acting as my home page. On this page I have customised the header to be sticky so that it appears under a video on loading the page and as you scroll down it sticks to the top. This works perfect on the home page but it is the only page that i want it to appear. It doesnt happen on the contact us or about page however at the moment it is appearing on the portfolio subpages which are linked to the home page. Does anyone know how to exclude this style from appearing on the subpages. Below is the code I have currently <style> @media screen and (min-width: 768px) { #header { position: sticky; top: 0; display: none; z-index: 10000; } main .page-section:first-child + #header { display: block; } main .page-section:first-child { min-height: calc(100vh - 93px)!important; } } </style> Link to comment
Ziggy Posted September 30, 2022 Share Posted September 30, 2022 Hi @BryanMinton, instead of placing this code in the header injection, you could put it in the Custom CSS and target it to the page Collection ID, that way it would only affect the homepage. If you can share your website URL and site wide password if applicable then I can provide you with the full CSS. Please like and upvote if my comments were helpful to you. Cheers! Zygmunt Spray Squarespace Website Designer Contact me: https://squarefortytwo.com Hire me on Upwork! 🔌 Ghost Squarespace Plugins (Referral link) 📈 SEO Space (Referral link) ⬛ SquareWebsites Plugins (Referral link) 🔲 SQSP Themes (Referral link) ✨ Spark Plugin (Referral link) 🖼️ Gallery Lightbox Plugin (Referral link) ☕ Did I help? Buy me a coffee? Link to comment
BryanMinton Posted September 30, 2022 Author Share Posted September 30, 2022 1 hour ago, Ziggy said: Hi @BryanMinton, instead of placing this code in the header injection, you could put it in the Custom CSS and target it to the page Collection ID, that way it would only affect the homepage. If you can share your website URL and site wide password if applicable then I can provide you with the full CSS. I have applied it to the home page settings in the pages tab. Is it better to move this to the custom css in design instead? Link to comment
Ziggy Posted September 30, 2022 Share Posted September 30, 2022 1 minute ago, BryanMinton said: Is it better to move this to the custom css in design instead? Yes, it can be. Though you could add the Page ID to the code where you have it. Please like and upvote if my comments were helpful to you. Cheers! Zygmunt Spray Squarespace Website Designer Contact me: https://squarefortytwo.com Hire me on Upwork! 🔌 Ghost Squarespace Plugins (Referral link) 📈 SEO Space (Referral link) ⬛ SquareWebsites Plugins (Referral link) 🔲 SQSP Themes (Referral link) ✨ Spark Plugin (Referral link) 🖼️ Gallery Lightbox Plugin (Referral link) ☕ Did I help? Buy me a coffee? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment