← Back to properties

CSS Property

position

Positioning

Defines how an element is positioned and how it interacts with normal document flow (static, relative, absolute, fixed, sticky).

Syntax

position: value;

Example

position: absolute;

Common use cases

  • Overlaying elements with absolute positioning
  • Sticky headers and sidebars
  • Fixed banners or modals

Practical developer insight

absolute positioning is relative to the nearest ancestor with position other than static — always check your parent chain.

Related properties