Jump to content

Change transparent header to solid background on scroll

Recommended Posts

  • Replies 8
  • Views 1.6k
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...

Hi, it's www.porfiriogutierrez.com.

I have it set to a nav bar with white background for now, but would like a transparent one with white text that converts on scroll to a solid white background with black text, as in the norlha.com example. 

Edited by mphdesign
Link to comment
On 7/8/2023 at 6:37 AM, mphdesign said:

Hi, it's www.porfiriogutierrez.com.

I have it set to a nav bar with white background for now, but would like a transparent one with white text that converts on scroll to a solid white background with black text, as in the norlha.com example. 

Add this code to Design > Custom CSS

body.homepage article section:first-child {
    padding-top: 0 !important;
}
body.homepage header#header:not(.shrink) .header-background-solid {
    background-color: transparent !important;
    opacity: 0 !important;
}
body.homepage header#header:not(.shrink) a {
    color: white !important;
}
body.homepage article section:first-child .content-wrapper {
    padding-top: 0 !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
On 7/12/2023 at 7:21 AM, mphdesign said:

I'm noticing the transparent overlay doesn't work on mobile and the logo doesn't show. The main menu also doesn't show up when you click on the hamburger. Do you have a solution for this?

Hi,

It looks fine to me

image.thumb.png.e1ee69ef16ed57f30847940d4f3ff20d.png

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
  • 6 months later...
On 7/9/2023 at 4:57 AM, tuanphan said:
body.homepage article section:first-child {
    padding-top: 0 !important;
}
body.homepage header#header:not(.shrink) .header-background-solid {
    background-color: transparent !important;
    opacity: 0 !important;
}
body.homepage header#header:not(.shrink) a {
    color: white !important;
}
body.homepage article section:first-child .content-wrapper {
    padding-top: 0 !important;
}

Can we do this for all pages? Not just the homepage...

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.