Simple Elementor Transparent Header Changing Background Color

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.

You can also check out this related premium tutorial to have even more control over your design:

 

Elementor Header Change Color On Scroll Dynamically

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.

<script> 
/* Please login to get the code 
 * The code will be for the Simple Elementor Transparent Header Changing Background Color tutorial 
 * Found at this URL https://element.how/elementor-transparent-header-changing-color/ 
 */ 
</script>

Et voila! Thanks for reading!

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

  3. Hello - this works great! but the button border doesn't change colour. Do you have any CSS for the button border colour also changing on sticky header? Thanks!

  4. Hi Maxime!
    This works great - my only issue is that I want to keep the button text the same color on scroll - is there a way to do this?
    Many thanks - Heather

Leave a Reply