Welcome to You!

Be with the calm of nature in our wonderful lake rental

Simple Elementor Transparent Header Changing Background Color On Scroll

No extra plug-ins required! Elementor Pro required.

To begin with, create your hero section

Simple Elementor Transparent Header Changing Background Color

Then, above it, create a new section

This is where the Elementor sticky transparent header will be. Give that section this width setting.

Simple Elementor Transparent Header Changing Background Color

Create your header within that Elementor Section

Give that section  the class ‘stickyheadersection’ . Adjust the padding to what you need. 

Simple Elementor Transparent Header Changing Background Color

Now, set the Elementor header section to sticky.

Set it sticky. (This is an Elementor Pro feature)

Elementor Sticky Header Changes Logo Size and Position

And give it negative margins to bring it above the hero section. Also give it a z-index value of 999.

Simple Elementor Transparent Header Changing Background Color

Then, set 'Effects Offset' to '30', or your preferred value

This will determine when it will go from transparent to the color you will set in the code.

Simple Elementor Transparent Header Changing Background Color

Finally, add this CSS to the place of your choice

Adjust the background color to your desired value. When scrolling down, the Elementor transparent sticky header will change to that color.



.stickyheadersection {
transition: background-color .4s ease;
}

.elementor-sticky--effects.stickyheadersection {
background-color: #fff; /* Background color when sticky */
box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.29); /* remove if you don't want a box shadow on the sticky header */
}

.elementor-sticky--effects.stickyheadersection a {
color: #000!important; /* Change this to the color of the links when sticky is active */
}


Et voila! Thanks for reading!

14 Responses

  1. Hello, does this create the same type of header you have on this website? When i set the the negative padding at the top, the header changes to the colour like its already started scrolling. What am i doing wrong?

    1. I updated the tutorial with slightly different instructions, and it is a better and more resilient way to make this! Let me know if it works for you. Start from fresh, as the code is different now.

  2. Excuse me! I am a beginner... what do you mean "add this CSS to the place of your choice". It should be in the sticky section > advanced > custom css or in another place? Thanks a lot!!!!!

      1. Great work Victoria! Don't hesitate with any other questions!

Leave a Reply