Master

Reading what a page actually did

A page is a negotiation between your markup, your stylesheet, the browser defaults, and the window size. When the result is wrong, the answer is in what the browser computed, and reading that is a skill worth learning rather than guessing at.

What you will see

The query at the observed width. A query at 768 for the same problem is a guess, and guesses leave the gap between them.

About 1 min of reading

Try It

Find the real breakpoint.

1

Narrow slowly

drag the window narrower one pixel at a time

Before you run it, say out loud what it will print. Then open the answer.

What it prints
The width where a row wraps or text touches an edge. That number is the breakpoint, and it came from the page, not from a device list.
2

Write it where it broke

@media (max-width: 412px) { .toolbar { flex-direction: column; } }

Before you run it, say out loud what it will print. Then open the answer.

What it prints
The query at the observed width. A query at 768 for the same problem is a guess, and guesses leave the gap between them.

Data Flow

The browser reports the negotiation.
1 Open the element in the tool
↓
2 Read the matched and lost rules
↓
3 Read the computed box
↓
4 Change one input and watch
Why this works
Reproduce in the smallest case

A bug in a full page is the same bug in a small one, and the small one is readable. Cutting the markup down to the element and its parent is the step that turns a hunt into a read.

Trust the render, not the file

A stylesheet that is cached, a build step that did not run, or a file you are not loading all look correct in the editor and wrong in the browser. Checking the loaded URL is the first move when nothing changes.

Examples

Computed values, not written ones

The browser reports the size each element ended up with. A percentage, a flex rule, and a max width resolve to a number, and reading that number tells you which input was wrong.

Which rules lost

The tool shows the rules that matched and were overridden, with the reason. That list is the answer to 'why is this blue' and it saves the reasoning that usually gets it wrong.

Change the width and watch

Resize slowly and watch where the layout breaks. The width where it breaks is the breakpoint you needed, found by observation rather than by guessing a device width.

Words this lesson uses

Each one is defined here on this site. Open the entry for the full definition and the other words it points at.

← A stylesheet that survives change
Previous Lesson
A stylesheet that survives change
Next Lesson
Designing with the constraints
Designing with the constraints →