Skip to content

FlashcardNot attempted

Position values

Recall it before you reveal

Explain static, relative, absolute, fixed and sticky.

Space to reveal
Show answer & explanation
  • static: normal flow; top/left/z-index are ignored.
  • relative: normal flow, then nudged by top/left; becomes the containing block for absolute children.
  • absolute: removed from flow; positioned against the nearest positioned ancestor.
  • fixed: removed from flow; positioned against the viewport (unless an ancestor has transform/filter, which traps it).
  • sticky: flows normally until it hits its top/left threshold within its scroll container, then sticks. Needs a threshold and an overflow-free ancestor.