0Pricing
CSS Academy · Lesson

Absolute Positioning and Containing Block

Position elements absolutely relative to their nearest positioned ancestor.

position: absolute

An absolutely positioned element is removed from normal document flow. Other elements act as if it does not exist. It is positioned relative to its nearest positioned ancestor.

The Containing Block

The containing block for an absolutely positioned element is its nearest ancestor with a position value other than static. If none exists, the element is positioned relative to the initial containing block (the viewport).

All lessons in this course

  1. Static and Relative Positioning
  2. Absolute Positioning and Containing Block
  3. Fixed and Sticky Positioning
  4. Z-index and Stacking Context
← Back to CSS Academy