tevestudios Posted February 6 Posted February 6 Hi! For a website I'm working on, I'm trying to create a transparent, fixed header that will change it's font & logo color on scroll. For example; on the homepage you'll see a transparent header with an off-white logo & navigation and I want to let it change to a white background with a black logo & navigation when scrolling. (I'm not looking for changing the color settings of the block below). Is there anyone who has some code to do it? URL: https://notyourtherapist.squarespace.com/ password: anuroopa Thank you!
tuanphan Posted February 8 Posted February 8 You can use this code to Website > Website Tools > Custom CSS /* HOMEPAGE - Header scroll */ body.homepage { /* header color */ header#header.shrink { background-color: white !important; } header#header.shrink img { filter: invert(0); } /* navigation items */ header#header.shrink div.header-nav-item>a { color: #000 !important; } /* Burger Icon */ header#header.shrink .burger-inner>div { background-color: #000 !important; } } /* Burger X Close icon */ body.homepage.header--menu-open header#header.shrink .burger-inner>div { background-color: #000 !important; } 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!)
tevestudios Posted February 8 Author Posted February 8 @tuanphan thank you so much! This worked! Last question; what if I want to add this to a specific page? What do I use instead of body.homepage?
Solution tuanphan Posted February 11 Solution Posted February 11 On 2/8/2024 at 3:35 PM, tevestudios said: @tuanphan thank you so much! This worked! Last question; what if I want to add this to a specific page? What do I use instead of body.homepage? You can add this code to Page Header Code Injection or Code Block <style> /* header color */ header#header.shrink { background-color: white !important; } header#header.shrink img { filter: invert(0); } /* navigation items */ header#header.shrink div.header-nav-item>a { color: #000 !important; } /* Burger Icon */ header#header.shrink .burger-inner>div { background-color: #000 !important; } /* Burger X Close icon */ body.header--menu-open header#header.shrink .burger-inner>div { background-color: #000 !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!)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment