A gotcha with position: sticky
Lost an hour today to a layout issue: a sidebar's position: sticky refused to work.
Classic cause: if any ancestor has overflow: hidden (or auto, or scroll), sticky silently fails — it needs a scrollable context.
Debugging checklist
- The sticky element needs a
top(or similar) threshold - No non-visible overflow anywhere up the parent chain
- The parent must be tall enough — otherwise there's nothing to stick within
Written down so I trip over it once less.