What if you wanted a different header color JUST for the home page?
This is the snippet you’ll need.
.home #main-header, .home #main-header.et-fixed-header { background-color: transparent; } .home #page-container { padding-top: 0 !important; }
[sc name=”customcss”]
Of course, you can change the colors easily by swapping out the ‘transparent’ to something else.
Cool, I’ll just sign off with just that. Maybe I should get into dissecting the header sometime.. hmm.
[sc name=”learn css”]
Crawford says:
This is exactly what I’m looking for but I’m not 100% sure where to put that extra bit of css.
Thanks.
PK says:
Hi Crawford! You can drop that CSS in wp-admin > Divi > Theme Options > Custom CSS
Hope that helps!
CORY says:
Hi!
I love the CSS and the transparent header on just the home page. But it makes the sticky nav transparent on scroll, too. Is there an addition to the CSS to retain the sticky nav customization as it is throughout the site?
Cory says:
Hello, again!
I figured it out by adding :not(.et-fixed-header) to the CSS.
Thank you!
PK says:
Hi Cory,
That’s great, and thanks for coming back to comment on it so others can see the solution.
Thanks
Mary Jo says:
Who needs to go look at Divi FB group when search results bring PK himself. Nice job w/SEO!
PK says:
Hi Mary! Thank you for the kind words. As always, feel free to reach out if you have questions!
Peter e says:
Hi, when I apply the
.home #page-container {
padding-top: 0 !important;
}
It looks as desired, but when I scrolll down there is a slight jump, and then when I scroll back to the top there is a jump again, and the white background shows for a second. Any idea what is happening there?
Baba says:
@ Peter E, I have the same issue
PK says:
Hi Peter and Baba,
Feel free to email me here: http://almostinevitable.com/contact-me/ and send me a URL, and I can have a look for you.
If I had to guess, it’s probably a jquery script jumping in and out, and I’m sure there’s a way (like in the customizer settings or with extra CSS) of sorting that out.
Thanks
David says:
Hi PK,
I followed your tutorial but it pushes my hero section image into the header section.
PK says:
Hi David. Yes, that should be the case. The page body has white in the background, so even if the header is transparent, you can’t see that it’s transparent because of the white background. Everyone I’ve helped on this had wanted to have the header shown over the hero section image, so that’s what I’ve shared here. If you want the header transparent without the hero section underneath it, take out this part of the CSS:
.home #page-container {
padding-top: 0 !important;
}
Thanks!
Danel says:
How can I push the header down to make a full bleed nav and slider style?
PK says:
Hi, I’m not sure if this is about making a transparent header? If it’s something different, then could you please email me a link or design mockup of what you want, and I’ll see what I can do. Thanks