Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Sticky header changing height on scroll: how to fix the jump

PRF-035Low impactCould addBy FunnelGuardPublished Updated
On this page

What this issue is

A sticky header stays at the top of the screen while you scroll. Many themes make it shrink after a few pixels of scrolling: the logo gets smaller, the padding drops and the bar gets thinner. That looks neat, but it can also change how much room the header takes in the page.

When the height changes, everything below the header moves. This is a layout shift. Two common causes: the header switches from position: static to position: fixed and is taken out of the page flow, so content jumps up by the header's height; or a script changes the header's height or padding on scroll, so content moves a little on every step.

Why it costs you leads or sales

The impact is usually small, which is why this issue is rated low. But a jump while someone is reading or aiming at a button is annoying. A form field, a Buy button or a tab can slide away just before the tap. On phones the header is a larger share of the screen, so the effect is stronger.

Layout shifts caused directly by scrolling are often not counted in Cumulative Layout Shift, since shifts shortly after user input are excluded. The jump can still feel broken, and a header that jumps at page load or on a resize does count.

How a header jump affects a visitor
  1. Visitor scrollsScroll passes a small threshold
  2. Header resizesHeight or position changes
  3. Content jumpsText and buttons move
  4. Mis-tap or exitWrong click or lost place

The visitor scrolls, the header resizes, and the page moves under their finger.

How to check if your site has it

Check for a header jump
  1. Scroll slowly on a real page

    Open a landing page or product page. Scroll down 50 to 100 pixels and watch whether the text below the header jumps.

  2. Test on a phone size

    In Chrome DevTools, turn on device mode and repeat. Also test scrolling back to the top, where the header often grows again.

  3. Inspect the header

    Right-click the header, choose Inspect, then scroll and watch the Styles panel. Look for a class added on scroll (such as is-sticky or shrink) and for changes to height, padding, position or top.

  4. Record the layout shifts

    In DevTools open Performance, tick Screenshots, record while scrolling, and look for red Layout Shift entries in the Experience row. Click one to see which element moved.

How to fix it

The goal is that the header's footprint in the page never changes. Choose one of the approaches below, then apply it in your platform.

Sticky header with a stable footprintcss
/* Keep the header in the page flow and let the browser stick it */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 80px; /* fixed footprint */
}

/* Visual shrink only: no layout change */
.site-header .logo {
  transform-origin: left center;
  transition: transform 0.2s ease;
}
.site-header.is-scrolled .logo {
  transform: scale(0.8);
}
If you must use position: fixed, reserve the spacecss
body {
  padding-top: 80px; /* same as the header height */
}
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
}
Apply the fix on your platform
  1. Check the theme or builder setting

    Open Appearance > Customize (or your builder's header settings, such as Elementor, Divi or Astra) and look for Sticky header and Shrink on scroll. Turn shrink off, or set the sticky height equal to the normal height, then test.

  2. Add CSS if needed

    Go to Appearance > Customize > Additional CSS, and use the stable footprint pattern above with your theme's header class. Use a child theme or the Customizer so updates do not remove it.

Header behaviour before and after

Before

  • Header changes from 120px to 60px on scroll
  • Content below moves up by 60px
  • Header flickers near the scroll threshold

After

  • Header footprint stays at one fixed height
  • Only the logo scales, using transform
  • No movement of content below

How to confirm it's fixed

Confirmation checks
  • Scroll slowly down and up on desktop: no content jump and no flicker
  • Repeat on a phone-size viewport and on a real phone
  • Record a Performance trace while scrolling and find no new Layout Shift entries
  • Check anchor links: the target is not hidden under the header (consider scroll-margin-top)
  • Test a key page such as a form or product page, including a tap on the main button after scrolling

How to prevent it happening again

Theme updates, new builder widgets and new announcement bars can bring the shrink effect back. Add a scroll test to your release checklist for any change to the header, and keep header styles in one place so they are easy to review. Prefer position: sticky and transform for effects. When you add a banner above the header, retest, because it changes where the header sticks.

How FunnelGuard handles this

FunnelGuard does not check for this yet. A sticky header that changes height on scroll is a possible future check, but today it is not monitored.

What FunnelGuard does cover nearby: it runs your real customer journeys on a schedule, from the EU or the US, and checks that each step works, such as forms, checkouts, and booking and chat buttons. If a header problem stops a button from being clicked and a journey step fails, the failure is re-checked from a second region and you get one alert with a screenshot and a likely cause. It will not tell you that the header is jumping.

To watch for the jump yourself, run PageSpeed Insights or Lighthouse on key pages after theme changes, record a Performance trace in Chrome DevTools, and scroll your main pages on a phone as part of each release. The free plan (1 site, 2 journeys, daily checks, no card) can monitor your key journeys while you do this.

Questions people ask

Why does my sticky header make the page jump when I scroll?

Usually the header changes its height or switches from static to fixed positioning. Either change alters the space the header takes in the page, so the content below moves. Keeping the header's footprint constant stops the jump.

How do I stop a shrinking sticky header from causing layout shift?

Give the header a fixed height and shrink only inner elements with transform: scale(). Alternatively use position: sticky; top: 0, which keeps the header in the page flow. Do not animate height, padding or margin.

Does a sticky header affect Cumulative Layout Shift?

It can. Shifts that happen at load or on resize count, such as a header that changes size when scripts run. Shifts that follow user input like scrolling are often excluded from the score, but they can still feel broken to visitors.

Should I use position fixed or position sticky for a header?

Position sticky is usually simpler because the header stays in the page flow and no space needs reserving. Position fixed removes it from the flow, so you must add padding-top equal to the header height. Either works if the footprint stays constant.

Why does my header flicker when I scroll near the top?

The shrink often changes the page height, which changes the scroll position and triggers the opposite state, creating a loop. Make the shrink visual only, with transform, or add a gap between the shrink and grow thresholds.

How can I see which element shifted when I scroll?

Record a trace in the Chrome DevTools Performance panel while scrolling. Layout Shift entries appear in the Experience row, and clicking one shows the elements that moved and by how much.

Does FunnelGuard detect a sticky header that jumps on scroll?

No. FunnelGuard does not check for this yet, though it is a possible future check. It does run your funnel journeys and alerts you if a step fails, so a header issue that blocks a button could surface as a failed step.

Does FunnelGuard catch this?

Could add

Not checked yet: could be added to FunnelGuard.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.