Skip to main content
Module 9 · Lesson 1 of 433/60 in the course~20 min
Module lessons (1/4)

static, relative, absolute, fixed & sticky Without Pitfalls

Lesson preview5 hands-on exercises readyModern HTML & CSS · Positioning, Stacking Context & Container Queries

Anchor floating badges onto relative parents, pin sticky toolbars safely, and dodge overflow: hidden traps.

What you'll learn in this lesson

  • Master all five CSS position modes: static, relative, absolute, fixed, and sticky.
  • Understand how position: relative creates the anchor Containing Block for position: absolute badges and overlays.
  • Diagnose why overflow: hidden on an ancestor kills position: sticky—and cure it with overflow-x: clip.

Overview

Normal Flow lays boxes sequentially. Sometimes a corner "SALE" ribbon needs to sit tucked onto a card top-right corner, or a sidebar Table of Contents needs to glide cleanly beside a long article while scrolling.

Sections covered in this lesson

  1. 1Breaking Out of Normal Document Flow Safely
Pro Lesson · Positioning, Stacking Context & Container Queries

Unlock "static, relative, absolute, fixed & sticky Without Pitfalls" and the full Modern HTML & CSS curriculum

Anchor floating badges onto relative parents, pin sticky toolbars safely, and dodge overflow: hidden traps.

Unlock all 5 hands-on exercises in this lesson plus every advanced WebAssembly module with automated checks.

  • Instant access to all advanced modules in Modern HTML & CSS plus 17 more courses
  • Hands-on browser exercises with automated test suites and solutions
  • 14-day money-back guarantee processed via Paddle.com

14-day guarantee · Cancel anytimeModule 1, all 18 interactive games, and cheatsheets are always free.