liveBook · Manning

Relative positioning

Relative positioning offsets an element from its normal position while preserving its space in normal document flow.

How 3 Manning books explain it

Web Design Playground, Second Edition

Relative positioning is a CSS layout technique that visually shifts an element from its normal position while preserving its place in normal document flow.

How it is used
Uses relative positioning to shift an element while retaining its space, or to establish a context for an absolute overlay.
How deep it goes
Works through offset directions and a visible gap, then applies a relative container in a portfolio overlay.
Examples
Shows a span shifted down by top: 3em and a portfolio container holding an absolutely positioned after-image.
What you can do after
Apply it via CSS to offset an element or set the positioning context for an absolute image overlay.

Read how Web Design Playground, Second Edition explains relative positioning →

CSS in Depth, Second Edition

Relative positioning is a CSS positioning mode that keeps an element in normal flow while allowing offsets and establishing a containing block for positioned descendants.

How it is used
Anchors absolutely positioned descendants while keeping the anchor in normal document flow.
How deep it goes
Explains offset behavior and containing blocks through worked menus, then connects positioning to stacking order without detailing browser layout internals.
Examples
Uses shifted inline-block elements, a click-operated dropdown, and a mobile navigation menu.
What you can do after
Build it from scratch: anchor an absolutely positioned dropdown to its toggle using CSS and a JavaScript-controlled open state.

Read how CSS in Depth, Second Edition explains relative positioning →

Tiny CSS Projects

Relative positioning offsets an element from its normal position while preserving its original space in the document flow.

How it is used
Establishes local positioning contexts and makes small visual adjustments in card layouts and typography.
How deep it goes
Explains parent-child positioning and directional offsets, while demonstrating layering through absolute positioning rather than detailing browser internals.
Examples
Demonstrates a virtual credit card overlay and a decorative drop cap adjusted within paragraph text.
What you can do after
Apply it via CSS to establish local positioning contexts or nudge elements within their normal layout.

Read how Tiny CSS Projects explains relative positioning →

Also covered in

What to know first

Related concepts

Questions about relative positioning

What is relative positioning?

Relative positioning offsets an element from its normal position while preserving its space in normal document flow.

Which Manning books explain relative positioning?

Web Design Playground, Second Edition, CSS in Depth, Second Edition and Tiny CSS Projects.

What should I know before learning relative positioning?

Manning books that teach relative positioning usually introduce viewport, normal flow, containing block and CSS unit first.

What is the difference between relative positioning and sticky positioning?

Relative positioning offsets an element from its normal position while preserving its space in normal document flow. Sticky positioning is a CSS positioning mode in which an element remains in normal document flow until a specified offset threshold is reached, then stays constrained within its containing block as scrolling continues.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.