A Divi 5 sticky header takes four settings and no plugin. The header stays at the top of the screen while the page scrolls, and it can change once it sticks: clear over a photo at first, then a solid bar with a shadow, a little shorter so it takes less room. This guide builds exactly that, step by step, with the settings we measured on a live page.


How a sticky header works in Divi 5
Divi 5 can make any section, row or module sticky. You choose where it sticks under Advanced, Scroll Effects, and Divi does the rest: when the element reaches the top of the window, it gets the class et_pb_sticky and stays there. Divi also leaves an invisible copy in its old place, so the page below does not jump up.
The second half is the Sticky State. Most settings that can change on hover can also change while an element is stuck: background, shadow, height, colours. Those values apply only while the header is stuck, and the default values come back when the visitor scrolls to the top again.
Step 1: Build the header in the Theme Builder
A header that should stick on every page belongs in the Theme Builder. Go to Divi, Theme Builder, click Add Global Header on the Default Website Template and then Build Global Header. Our Divi 5 mega menu guide shows this screen if you have not used it before.
Build the header as one section: a full width row, and inside it a Group for the bar with your logo, the links and a button. Give the bar Group a fixed height (ours is 88px) and lay it out as a row with the items spaced between. The fixed height matters later, because the hero is pulled up by the same amount.
Step 2: Make the header section stick
Select the header section (not the row or the Group) and open Advanced, Scroll Effects.
- Sticky Position: Stick to Top.
- Sticky Top Offset: 0px, so it touches the top edge.
- Bottom Sticky Limit: None. A header should stay stuck all the way down the page.
- Offset From Surrounding Sticky Elements: off, unless another sticky bar sits above the header.
- Transition Default and Sticky Styles: on. This animates the change you set up in the next step instead of switching in one frame.

Good to know Put the sticky setting on the section, not on a Group inside a row. We tried a sticky Group in a flex row on another page: once it stuck, it jumped to the left edge of the row. A sticky full width section behaves every time.
Step 3: Style the header while it is stuck
Still on the header section, open the menu beside the Content, Design and Advanced tabs (it says Desktop) and choose Sticky. A pin icon replaces the device icon, the canvas shows the header as it looks when stuck, and every value you change now is saved for the sticky state only.
- Content, Background, Background Color: a solid colour. Ours is #111827. In the default state the same field holds the colour with 0% opacity, so the header is clear over the hero.
- Design, Box Shadow: a soft shadow (ours: 0px 6px 24px at 18% black). Leave the default state with no shadow.

Switch the menu back to Desktop when you are done, or the next changes go to the sticky state too.
Step 4: Let the header sit over the hero
A clear header only looks right if the hero photo runs up behind it. Select the first section under the header (the hero) and open Design, Spacing. Set Margin Top to minus the header height: -88px for an 88px bar. Then add the same amount or more to the hero's top padding, so its heading does not slide under the logo. Ours has 260px.

If the header is shorter on tablets and phones, switch the menu beside the tabs to Tablet and then Phone and set the margin for each, so the hero always meets the top of the screen exactly.
Step 5: Shrink the header on scroll
A shorter bar leaves more of the page in view. Select the bar Group inside the header, switch to the Sticky state as in Step 3, and in Design, Sizing set a smaller Height. Ours goes from 88px to 68px. The sticky state works on modules inside the sticky section too, not only on the section itself: we measured the bar at 88px at the top of the page and 68px once the header stuck.
To make the change smooth, give the bar Group a transition under Advanced, Transitions (300ms, ease in out), so the height eases down instead of snapping.
Step 6: Keep the header above everything
Open Advanced, Position on the header section and set a Z Index of 1000, so sliders, images and animated sections scroll under the header and not over it. Then switch to the Sticky state and set the Z Index to 1001.
Why one higher? The invisible copy Divi leaves in the header's old place has the same classes and the same Z Index. With equal values, the copy can end up on top of the real header and take the clicks meant for the menu. We saw exactly that on a test page: the menu button stopped responding. One step higher in the sticky state keeps the real header on top.
When the sticky header does not work
- It never sticks in the builder or a preview. Sticky only starts when the page itself scrolls. A preview frame sized to the full page never scrolls, so nothing sticks there. Check it on the front end in a normal browser window.
- It sticks 32px too low. That is the WordPress admin bar, which Divi makes room for while you are logged in. Visitors do not see it. Log out or open a private window to check.
- The header jumps sideways when it sticks. The sticky setting is on a Group or column inside a row. Move it to the section, as in Step 2.
- Content scrolls over the header. Set the Z Index from Step 6. A section with a transform, a scroll effect or its own Z Index can otherwise paint above it.
- There is a gap or the hero starts under the header. The hero's negative top margin does not match the header height on that device. Set it per device.
- Menu links stop working once stuck. The invisible copy is on top. Give the sticky state a Z Index one higher than the default.
Frequently asked questions
Do I need a plugin for a sticky header in Divi 5?
No. Sticky Position under Advanced, Scroll Effects and the Sticky State for styles are part of Divi 5. Everything in this guide uses those two and nothing else, no custom CSS either.
Can I make the header sticky on desktop only?
Yes. Sticky Position takes a value per device. Switch the menu beside the tabs from Desktop to Phone, set Sticky Position to Do Not Stick, and switch back. We checked it: the header stuck at 1440px and scrolled away normally at 390px.
Does a sticky header slow the page down?
Not noticeably. Divi loads its sticky script only on pages that use sticky elements, and the change between states is a CSS transition. Keep the shadow and the height change simple, and avoid putting a heavy video in the header.
Start from a ready header
Our free Divi 5 header layouts are built with these same settings. The Payments Mega Menu sticks to the top with a mega menu and a phone drawer, so you can import it and change the colours instead of starting from an empty section. New to importing? Here is how to import a Divi 5 layout, and once it is in, rebrand it with your global colours.



