Suggest an editImprove this articleRefine the answer for “What does position: fixed do? What does a fixed element attach to?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**`position: fixed`** removes the element from the flow (like `absolute`), but fixes its position relative to the browser window (viewport), so the element stays in place even when the page is scrolled. **Key point:** `fixed` anchors the element to the viewport, not to its parent, and keeps it on screen regardless of scrolling.Shown above the full answer for quick recall.Answer (EN)Image`position: fixed` removes the element from the flow (like `absolute`), but fixes its position **relative to the browser window (viewport)**. Such an element stays in place even when the page is scrolled. Characteristic features: - does not take up space in the flow: neighboring elements "do not see" it; - the coordinates `top`, `right`, `bottom`, `left` set the position **from the edge of the window**, not from an ancestor; - the element stays on screen while scrolling; - often used for headers, buttons, panels, and notifications. Example: ```css div { position: fixed; top: 0; right: 0; } ``` Summary: `fixed` anchors the element **to the viewport**, not to its parent, and keeps it on screen regardless of scrolling.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.