CSSCSS · Lesson 08

Display & Position

block, inline, inline-block, none; static, relative, absolute, fixed, sticky.

Video tutorialTrack course · freeCodeCamp
Speed
Next lesson
Watch 00:00 · 1 checkpoints Watch on YouTube More on this topic
Transcript & captions
7/7
  • static — the default, ignores top/left.
  • relative — offset from its normal place; creates a positioning context.
  • absolute — positioned against the nearest positioned ancestor.
  • fixed — positioned against the viewport, stays on scroll.
  • sticky — behaves like relative until it hits a scroll threshold.
Try it yourself

Knowledge check

0/1 answered

position: absolute is measured against…