IT lexicon › Web › Sticky positioning

Sticky positioning

Web På svenska → Updated: 2026-11-15

A CSS positioning mode that keeps an element visible at the same position while scrolling, until the element reaches the edge of its container.

position: sticky makes an element (typically a header or navigation bar) stay fixed in the viewport while scrolling, but only within its parent container's boundaries. Unlike position: fixed, a sticky element scrolls away when its container does. Implementing sticky positioning carelessly can trigger layout thrashing if the browser must recalculate position on every scroll event. Using modern containment strategies and avoiding expensive calculations in scroll handlers helps maintain performance.

← Back to the lexicon