Jump to content

Adaptive header on homepage only / solid header on all other pages?

Go to solution Solved by Beyondspace,

Recommended Posts

  • Replies 10
  • Views 784
  • Created
  • Last Reply

Top Posters In This Topic

9 hours ago, Celeste_Woodside said:

Hi there! I am looking for some code that will alllow for an adaptive header on the homepage but solid headers on all other pages.

TIA!!

site: https://www.alonasharon.com
pw: alona

How do the adaptive header and solid header look like? Can you show some examples?

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment
13 hours ago, Beyondspace said:

How do the adaptive header and solid header look like? Can you show some examples?

Adaptive:
image.thumb.png.7cfe186870cbf5bb7a6f97525948a298.png

and solid:

image.thumb.png.66b652b847fa957c82653ced8c2ae878.png

I would also want to use a different logo on the main page (as it is a logo meant for light backgrounds and the solid header uses the logo that is meant for dark backgrounds.)

TIA for any help you (or anyone) may offer!

Link to comment
On 4/7/2024 at 8:10 PM, Celeste_Woodside said:

Adaptive:
image.thumb.png.7cfe186870cbf5bb7a6f97525948a298.png

and solid:

image.thumb.png.66b652b847fa957c82653ced8c2ae878.png

I would also want to use a different logo on the main page (as it is a logo meant for light backgrounds and the solid header uses the logo that is meant for dark backgrounds.)

TIA for any help you (or anyone) may offer!

You can apply the following CSS code (add in custom CSS, not in code injection) to set the specific style for logo on Home Page only


#collection-65d4ca134ce2a875379c1be8 {
  .header {
    --solidheaderbackgroundcolor: transparent !important;
  }
  .header-title-logo {
    a {
      position: relative;
      img {
        visibility: hidden;
      }
      &:after {
        content: '';
        display: block;
        width: 100%;
        height: 100%;
        background-image: url(https://plus.unsplash.com/premium_photo-1712325632272-b0cbb2a27db6?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHwxfHx8ZW58MHx8fHx8); /*add your logo url here*/
        background-position: center center;
        background-size: cover;
        background-repeat: no-repeat;
        position: absolute;
        top: 0;
        left: 0;
      }
    }
  }
}

let me know how it works

Edited by Beyondspace

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment
  • Solution
16 hours ago, Celeste_Woodside said:

Hi there! Unfortunately it didn't work....It seemed to just make the logo transparent but not the header.... @Beyondspaceimage.thumb.png.e496f6586b9398ec551cbb2cdc506446.pnge! 

Try replacing my previous code with the following one

#collection-65d4ca134ce2a875379c1be8 .header {
  --solidHeaderBackgroundColor: transparent !important; 
}
#collection-65d4ca134ce2a875379c1be8 .header-title-logo a {
  position: relative;
}

#collection-65d4ca134ce2a875379c1be8 .header-title-logo a img {
  visibility: hidden;
}
#collection-65d4ca134ce2a875379c1be8 .header-title-logo a:after {
  content:'';
  display:block;
  width: 100%;
  height: 100%;
  background-image: url(https://plus.unsplash.com/premium_photo-1712325632272-b0cbb2a27db6?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHwxfHx8ZW58MHx8fHx8); 
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  position: absolute;
  top: 0;
  left:0;  
}

 

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment

Can you share the screenshot of syntax error?

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment

You can change this code

#collection-65d4ca134ce2a875379c1be8 .header {
  --solidHeaderBackgroundColor: transparent !important; 
}

to this code

#collection-65d4ca134ce2a875379c1be8 .header {
 background-color: transparent !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!)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.