cyclovfx Posted July 25, 2022 Share Posted July 25, 2022 Site URL: https://cyclovfx.squarespace.com Hello, I wanted to ask how I can have a different header style for my homepage. Which would be a Dynamic setting where I can have the background of the section below going into the header. But for other sites I would like to keep it as solid black. Link to comment
Beyondspace Posted July 25, 2022 Share Posted July 25, 2022 4 hours ago, cyclovfx said: Site URL: https://cyclovfx.squarespace.com Hello, I wanted to ask how I can have a different header style for my homepage. Which would be a Dynamic setting where I can have the background of the section below going into the header. But for other sites I would like to keep it as solid black. Transparent header when it is at the top of page and black solid when you scroll down, right? Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio pluginIf you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you Link to comment
Jennika Posted July 25, 2022 Share Posted July 25, 2022 You can use a NOT selector to make adjustments to headers on every page that is not the homepage. Basically, you would tell it that every page NOT identified by the homepage ID gets a different header styling (in this case, a solid black). The CSS would look something like this. body:NOT([id*="123456789"]) { #header { background-color:#000; other classes and styles } } Link to comment
creedon Posted July 25, 2022 Share Posted July 25, 2022 Site-wide password so we can see the site? Find my contributions useful? Please like, upvote, mark my answer as best , and see my profile. Thanks for your support! Link to comment
cyclovfx Posted July 26, 2022 Author Share Posted July 26, 2022 Thanks for the quick response. And sorry. I just started. and don't have much experience with CSS. could you help me to figure out where to get the id information? the pass is CYCLOXXX Link to comment
cyclovfx Posted July 26, 2022 Author Share Posted July 26, 2022 I found a chrome extension Squarespace ID Finder. will try this. 😄 creedon 1 Link to comment
cyclovfx Posted July 26, 2022 Author Share Posted July 26, 2022 18 hours ago, Jennika said: You can use a NOT selector to make adjustments to headers on every page that is not the homepage. Basically, you would tell it that every page NOT identified by the homepage ID gets a different header styling (in this case, a solid black). The CSS would look something like this. body:NOT([id*="123456789"]) { #header { background-color:#000; other classes and styles } } I think I didn't get it correctly ..... this CSS will give all other headers a black solid instead of the "dynamic style" that is defined for the homepage. Is that correct? - I tried #collection-62c695b5e721f57173873af3 (which is the header id of the "home page" .. instead of id* - not sure what to change for "other classes and styles" body:NOT([#collection-62c695b5e721f57173873af3]) { #header { background-color:#000; solid } } Link to comment
cyclovfx Posted July 26, 2022 Author Share Posted July 26, 2022 (edited) I think I found a work around to my problem. Just added a empty section 1 row under the header. that way I could block the BG image from the section below, so it won't go into the header. It's not ideal (because it makes the header bigger) but for now it kinda works. 😄 Edited July 26, 2022 by cyclovfx Link to comment
Jennika Posted July 26, 2022 Share Posted July 26, 2022 Yes, with the NOT selector, it would look to see if the page ID matches the homepage. If it does not match the homepage ID, then it would add whatever CSS you've defined for the not homepage header. All of the style for the black header (not homepage) goes inside the body:NOT tags, similar to how you would style your normal header. Here is an example using just really basic styling. body:NOT([id*="collection-62c695b5e721f57173873af3"]) { #header {background-color:#000 !important;} #site-title {color:#fff;} .header-nav-item a {color:#fff;} } "Other classes and styles" meant you needed to add whatever ids (i.e. #header), classes (i.e. .header-nav-item a), and their associated styles (i.e. color:#fff;) to make the header look how you want. cyclovfx 1 Link to comment
paul2009 Posted July 26, 2022 Share Posted July 26, 2022 49 minutes ago, Jennika said: Yes, with the NOT selector, it would look to see if the page ID matches the homepage. If it does not match the homepage ID, then it would add whatever CSS you've defined for the not homepage header. A few small things worth adding for the benefit of anyone learning this: :not() is a pseudo-class. It is added to a selector to prevent specific items from being selected it is convention to write it in lowercase a Squarespace site's homepage has a "homepage" class, so it is usually easier to use this (.homepage) instead of the page's unique page ID. cyclovfx 1 About: Squarespace Circle Leader since 2017. I value honesty, transparency, diversity and great design ♥.Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™. Content: Links in my posts may refer to SF Digital products or may be affiliate links. Catch up on all the release notes and announcements 2023 [for Circle members only]. There's a public version here too!If I helped, you can thank me by clicking one of the emojis below. If you prefer, you can buy me a coffee.Improve your online store with our extensions. Link to comment
cyclovfx Posted July 26, 2022 Author Share Posted July 26, 2022 (edited) 5 hours ago, paul2009 said: a Squarespace site's homepage has a "homepage" class, so it is usually easier to use this (.homepage) instead of the page's unique page ID. thanks! this did the final trick for the hompage to act correctly. body:not(.homepage) { #header {background-color:#000 !important;} #site-title {color:#fff;} .header-nav-item a {color:#fff;} } Edited July 26, 2022 by cyclovfx paul2009 and Jennika 2 Link to comment
cyclovfx Posted September 8, 2022 Author Share Posted September 8, 2022 hello. may I ask if it is possible to add another exception for other pages I would like to have the same header look? I tried to add another page into the script. but it screwed up everything 😄 currently not working added page: body:not(.homepage) (/rom) Link to comment
tuanphan Posted September 9, 2022 Share Posted September 9, 2022 22 hours ago, cyclovfx said: hello. may I ask if it is possible to add another exception for other pages I would like to have the same header look? I tried to add another page into the script. but it screwed up everything 😄 currently not working added page: body:not(.homepage) (/rom) This code is invalid. Which page you want to add the code? We can adjust it for you Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
cyclovfx Posted September 9, 2022 Author Share Posted September 9, 2022 hello Tuan. thanks for the reply. would be nice to get one example for this page /all-of-us-are-dead-breakdown the reason behind that. is that for some pages I would like to keep the background video fully shown on top of the page. instead of the black bar that's been covered by the Header. Link to comment
tuanphan Posted September 10, 2022 Share Posted September 10, 2022 On 9/9/2022 at 3:57 PM, cyclovfx said: hello Tuan. thanks for the reply. would be nice to get one example for this page /all-of-us-are-dead-breakdown the reason behind that. is that for some pages I would like to keep the background video fully shown on top of the page. instead of the black bar that's been covered by the Header. Try this body:not(.homepage), body:not(#collection-62d533a916735d11ae3f80bd) { #header {background-color:#000 !important;} #site-title {color:#fff;} .header-nav-item a {color:#fff;} } Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
cyclovfx Posted September 13, 2022 Author Share Posted September 13, 2022 On 9/10/2022 at 5:19 PM, tuanphan said: Try this body:not(.homepage), body:not(#collection-62d533a916735d11ae3f80bd) { #header {background-color:#000 !important;} #site-title {color:#fff;} .header-nav-item a {color:#fff;} } Hi Tuan. Thanks for the suggestion. But it doesn't seem to work. 😕 Link to comment
tuanphan Posted September 17, 2022 Share Posted September 17, 2022 On 9/13/2022 at 11:40 AM, cyclovfx said: Hi Tuan. Thanks for the suggestion. But it doesn't seem to work. 😕 You mean, this page & homepage, header should be transparent? https://cyclovfx.squarespace.com/all-of-us-are-dead-breakdown Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
cyclovfx Posted September 19, 2022 Author Share Posted September 19, 2022 correct. I am looking for a way to do exception for other pages beside the homepage. Link to comment
Solution tuanphan Posted September 20, 2022 Solution Share Posted September 20, 2022 22 hours ago, cyclovfx said: correct. I am looking for a way to do exception for other pages beside the homepage. Don't remove any code in your current code. Add this to Design > Custom CSS > then save & reload the site body#collection-62d533a916735d11ae3f80bd header#header, body.homepage header#header { background-color: transparent !important; } cyclovfx 1 Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
cyclovfx Posted September 20, 2022 Author Share Posted September 20, 2022 30 minutes ago, tuanphan said: Don't remove any code in your current code. Add this to Design > Custom CSS > then save & reload the site body#collection-62d533a916735d11ae3f80bd header#header, body.homepage header#header { background-color: transparent !important; } thanks. that seems to work. and I also tried for other pages I want to add as an exception. Thank you very much! Link to comment
tuanphan Posted September 20, 2022 Share Posted September 20, 2022 13 hours ago, cyclovfx said: thanks. that seems to work. and I also tried for other pages I want to add as an exception. Thank you very much! Did you solve or still need help? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
cyclovfx Posted September 21, 2022 Author Share Posted September 21, 2022 7 hours ago, tuanphan said: Did you solve or still need help? Yes. Problem solved. Thank you very much! tuanphan 1 Link to comment
EmilyMMorris Posted Wednesday at 08:04 PM Share Posted Wednesday at 08:04 PM I tried this, but now on my pages that have a white background, some of my tabs in my header are not showing up Link to comment
tuanphan Posted 21 hours ago Share Posted 21 hours ago On 6/8/2023 at 3:04 AM, EmilyMMorris said: I tried this, but now on my pages that have a white background, some of my tabs in my header are not showing up What is your site url? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care 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