Intern Track Roadmap

Positioning (relative/absolute)

This course covers the CSS position property and its values. It starts with static, the default where the top, right, bottom and left offsets are ignored. It then explains relative, which nudges an element while its space stays reserved, and absolute, which removes an element from flow and places it against the nearest positioned ancestor. Lessons cover the relative plus absolute pattern for badges, dropdowns and tooltips, fixed elements anchored to the viewport, and z-index for stacking order. A final lesson combines them in one page.

What you'll learn

  • ✓How position: static works and why offsets are ignored on it
  • ✓Nudging an element with position: relative while its space stays reserved
  • ✓Placing elements with position: absolute against the nearest positioned ancestor
  • ✓Using a relative container with an absolute child for badges, dropdowns and tooltips
  • ✓Anchoring elements to the viewport with position: fixed
  • ✓Controlling overlap with source order and z-index
Free preview · Lesson 1 3 min read

position: static — the default you've always had

Every element in every course so far, under normal flow or flexbox, shared one setting you never wrote: position: static. It's the default value of a property this course finally names.

Read the full lesson free →

Curriculum

7 lessons
Type to start searching...