FrontendDeveloper.in

CSS question detail

What is the difference between `position: relative`, `absolute`, `fixed`, and `sticky`?

  • relative: keeps element in normal flow, allows offset positioning.
  • absolute: removed from flow, positioned against nearest positioned ancestor.
  • fixed: positioned relative to viewport.
  • sticky: behaves like relative until threshold, then sticks like fixed.
Back to all CSS questions
Get LinkedIn Premium at Rs 399