Related: Learn more about WordPress
How to create a sticky header in Elementor Pro that appears on scroll
In this tutorial I show you how to hide a section in Elementor Pro and only show it when your visitor scrolls down. At the top of the page you see a normal header. When you scroll, a completely different header slides in from the top. When you scroll back up, it disappears again.
You are not limited to headers. On my services page I used the same trick for a call to action bar that only appears after you scroll past a certain point. You decide what the section looks like and where it shows up.
Good to know: I recorded this video in 2020, when Elementor still worked with sections and columns. The editor looks different today. For a newer walkthrough of headers, watch my Elementor Pro header tutorial.
What you need
- A WordPress website with Elementor Pro (you need the Theme Builder and Motion Effects)
- A little bit of custom CSS (you do not have to understand it, you only copy it)
Step 1: Prepare your headers in the Theme Builder
- If you already have a header that is shown on the home page, open it and go to Display Conditions. Exclude the front page and save. Now the old header is gone from the home page.
- Go to Templates, Theme Builder and click Add New, Header. You can import a premade header, but I start from scratch.
- Build your normal header: logo, menu and a button. I set the column widths to 25, 50 and 25.
- Duplicate that section. The copy becomes the header that appears on scroll. I gave it a dark background, a white logo with the same size, a white menu that turns greyish on hover, and a button that turns green on hover.
- Check tablet and mobile. On mobile I hid one column with the Responsive settings.
Give both sections the same height. I used a minimum height of 70 pixels. Then open the Navigator and rename the sections, for example “static header” and “sticky header”. That makes the next steps much easier.
Step 2: Make the second header sticky
- Select the sticky header section and go to Advanced. Give it a CSS class, for example sticky-header.
- Go to Motion Effects and set Sticky to Top.
- Publish the header and set the display condition to the front page.
To test the scrolling, I added a temporary extra section with a minimum height of 800, a gradient background and the word “reference” in it. That way you can see that you are scrolling. Delete it when you are done.
Step 3: Hide the sticky header until you scroll
Right now you see both headers on top of each other. That looks weird. This is where a small piece of custom CSS comes in. Paste it in Advanced, Custom CSS of the sticky header section. In plain words, the code does this:
- Normally, the sticky header sits 70 pixels higher than the top of the screen and has a z-index of -1, so it hides behind the static header.
- It moves to its new position with a transition of one second and an ease animation.
- The word “important” makes sure the code overrules the Elementor settings.
- When you scroll, Elementor adds a special class to the sticky section. The second part of the code says: at that moment, go to top 0 and use a z-index of 10, so the header comes in front of everything.
After pasting it, a few things still need fixing:
- Give the static header a background that is almost white, so you do not see the sticky header behind it.
- To remove the gap, go to the static header, Advanced, and set the bottom margin to -70. The next section moves up.
- If the header appears too early, go back to the sticky header, Motion Effects, and change the Effects Offset. With 300 it appears after 300 pixels of scrolling. I ended with 140, so it shows up just as the static header leaves the screen.
Tip: check the result in a browser where you are not logged in. When you are logged in, the WordPress admin bar sits at the top and the header can look slightly off.
Step 4: Use the same trick for a call to action bar
On my services page I wanted a bar that only appears after you scroll past the first area. Here is how I did it:
- Edit the page and add a new section at the top with a dark background, a white heading and a button on the right. I gave it a minimum height of 60 (later 70).
- Set Motion Effects, Sticky to Top.
- Give it its own CSS class, for example sticky-el, and paste the same custom CSS with that class name.
- Set a negative bottom margin of -70 so the bar is hidden at the start.
- Set the z-index for the scrolling state to 10 so the bar comes to the front, then update.
Now the bar shows up as soon as you scroll past that area and disappears again when you scroll back up.
Tips and mistakes to avoid
- Do you see nothing at all when you scroll? Then the header is still behind the other layers. Check the z-index for the scrolling state.
- Keep the heights consistent. The 70 pixels in the CSS, the minimum height and the negative margin should match.
- Use clear names in the Navigator. With two headers on one page it is easy to edit the wrong one.
- If the animation stutters a bit while you test, check what else your computer is doing. In my case it stuttered because I was recording and playing a background video at the same time.
Frequently asked questions
Can I make a sticky header with the free version of Elementor?
In this tutorial I use the Theme Builder and the Sticky motion effect, which are part of Elementor Pro. If you are new to Elementor, start with my Elementor tutorial for beginners, and see the Elementor Pro tutorial for the Pro features.
Do I need to know CSS?
No. I am not a CSS guru either. You copy the code, paste it in the Custom CSS field and only change the class name, the height and the z-index.
How do I control when the header appears?
With the Effects Offset in Motion Effects. The number is how many pixels the visitor scrolls before the sticky effect starts.
Can I hide the sticky header on mobile?
Yes. Every section and column has Responsive settings in the Advanced tab, where you can hide it on desktop, tablet or mobile.



I am your student
Love that, Jamil! Welcome! Hope you find the tutorials helpful. Feel free to ask questions along the way!