Course contentsShow
← Web Development
Lesson 211 of 2,9824. CSS Layout FoundationsFree lesson

The position Property: Overview

Introduction to the five positioning schemes: static, relative, absolute, fixed, and sticky.

The position Property: Overview

You'll learn how CSS offers five different positioning schemes that let you move elements outside their normal flow position.

The Five Positioning Schemes

Until now, every element you've styled has stayed in normal flow—either stacking as blocks or flowing inline. The position property breaks those rules, giving you control over where and how elements are placed on the page.

CSS provides five values for position:

1. static (the default)

The element stays in normal flow, exactly where it naturally belongs. This is what you've been using all along—no special positioning.

2. relative

The element starts in its normal flow position but can be nudged from that spot. Think of it like moving a book on a shelf while its "ghost" keeps the original space reserved.

3. absolute

The element is removed from normal flow entirely and positioned relative to its nearest positioned ancestor. Like lifting a sticker off one page and placing it anywhere on another.

4. fixed

The element is removed from normal flow and positioned relative to the browser window itself. It stays put when you scroll—like a sticky note on your monitor (not the webpage).

5. sticky

A hybrid: the element acts like relative until you scroll past a threshold, then switches to behave like fixed. Think of a header that scrolls normally at first, then "sticks" to the top.

Why This Matters

Each positioning scheme solves different layout problems. static keeps things predictable. relative makes small adjustments. absolute creates overlays. fixed builds navigation bars. sticky combines scrolling and anchoring behaviors.

Key Takeaway: The position property controls whether elements follow normal flow (static), shift from their spot (relative), or break free entirely (absolute, fixed, sticky)—each serving distinct layout needs.