Skip to content
Preptima
mediumConceptMidSenior

A fixed header starts scrolling away with the page after someone adds an animation to a wrapper div. What happened, and how would you track it down?

4 min readUpdated 2026-08-15Target archetype: Big Tech, Enterprise Captive, Product Startup

Answer

Short answer

A transform, filter, perspective or containment on an ancestor makes that ancestor the containing block for fixed-position descendants, so the header is now positioned and clipped relative to the wrapper instead of the viewport.

Was this answer helpful?

Likely follow-ups

  • Where exactly does the header get clipped now, and which declaration on the wrapper decides that?
  • How does a dialog opened with showModal escape this problem, and what do you give up in return?
  • A percentage width on the fixed element resolves to a different number after the change. Why?
  • A sticky sidebar never sticks anywhere. Which two ancestors do you suspect, and how do you tell them apart?

Related questions

Further reading

Related Topics