How the web works

From a file
to something you can see.

Your browser receives instructions, not a finished screenshot. Follow a tiny page from HTML to structure, layout and pixels.

Follow the explanation ↓

Follow the idea

Build the visible page.

Simplified rendering model. Browsers can stream work, fetch resources in parallel and repeat stages after changes.

01 / 04

Turn markup into a structure.

The response for /moon contains a heading and a paragraph. The browser parses that HTML into the Document Object Model (DOM), a tree of elements and text. The tree describes the document before the browser draws it.

02 / 04

Work out the styles.

CSS rules contribute values such as color, font and spacing. The browser combines the document structure with styles to determine how visible content should appear. The same words can have a different presentation.

03 / 04

Find where each piece fits.

Layout determines sizes and positions. A narrower viewport can make a sentence wrap onto more lines, pushing the next element down. The browser recalculates the geometry; it does not need a separate picture for every screen size.

04 / 04

Paint, combine, then update.

Painting produces the visual content; compositing combines layers for display. JavaScript can change the document or styles and trigger more work. Not every change repeats every step, and the first visible content need not wait for every resource.

Make a prediction

You change a paragraph’s text color. Must the browser download new HTML?

Same document. Different space.

Change the width and watch the sentence wrap. Its text stays the same; the layout changes.

Look up.

Find a familiar pattern in the night sky, then follow it from one star to the next.

One heading. One paragraph.

This resizes only the example—not your browser.

Sources & scope

This is an illustrated explanation, not a live browser trace. Written for Nemonic with AI assistance; primary references checked November 6, 2026.