Divi – transparent header only on home page

Divi – transparent header only on home page

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”]

 

[gravityform id=”1″ title=”False”]

 

Why no ads?

Hi, my name is PK, and welcome to my website, almost inevitable design. I maintain and publish on this site for two reasons.

  1. To give back to the community. I learned so much from people's tutorials and StackOverflow that I wanted to contribute and help others.
  2. To provide a more structured learning experience. People struggle to find the course that guides them from start to finish, based off of real life experience, and my courses provide that.

The only "ads" I have here are for my own courses, and maybe an affiliate link, but that's it. They fund the website resources and provide more motivation for me to product better content.

Any bit of interest helps. Even sharing with your feidns, suggesting my courses to your developer or designer, or subscribing to my YT channel, or joining our Discord. Thanks and I'll see you around!

The Web Design Space

TWDS is my web design agency. If you're looking for premium quality, reliable, web design and development, come see what we're about!
Learn More
Choose "Paythen" at checkout for an interest free 10 week payment plan.
Leave a Reply

Your email address will not be published. Required fields are marked *

  1. This is exactly what I’m looking for but I’m not 100% sure where to put that extra bit of css.

    Thanks.

    • Hi Crawford! You can drop that CSS in wp-admin > Divi > Theme Options > Custom CSS

      Hope that helps!

  2. 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?

    • Hello, again!

      I figured it out by adding :not(.et-fixed-header) to the CSS.

      Thank you!

      • Hi Cory,

        That’s great, and thanks for coming back to comment on it so others can see the solution.

        Thanks

  3. Who needs to go look at Divi FB group when search results bring PK himself. Nice job w/SEO!

    • Hi Mary! Thank you for the kind words. As always, feel free to reach out if you have questions!

  4. 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?

    • @ Peter E, I have the same issue

      • Hi Peter and Baba,

        Feel free to email me here: //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

  5. Hi PK,

    I followed your tutorial but it pushes my hero section image into the header section.

    • 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!

  6. How can I push the header down to make a full bleed nav and slider style?

    • 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

New tutorials