Lesson 11 of 50
cssPositioning
11 mins
Course progress22%
What you'll learn
Keep these ideas in mind as you work through the lesson.
Lesson 11 of 50
css11 mins
Keep these ideas in mind as you work through the lesson.
Four positioning schemes:
| Value | Behaviour |
|---|---|
static | Normal flow (default). |
relative | Offset from its static position; keeps space in flow. |
absolute | Removed from flow; positioned relative to the nearest positioned ancestor. |
fixed | Removed from flow; positioned relative to the viewport (stays on scroll). |
sticky | Behaves like relative until a scroll threshold, then becomes fixed. |
header { position:sticky; top:0; background:#fff; z-index:10; }