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
- Static and Relative Positioning
- Absolute Positioning and Containing Block
- Fixed and Sticky Positioning
- Z-index and Stacking Context