How a Browser Builds the Page
We've met the three materials: structure, looks, and behavior. But files alone aren't a page. Someone has to read them and build the thing you see. That someone is your browser, and today we watch it work.
The browser is the construction crew. It takes plain instructions and puts up a real, visible page — and it does it every single time you load a site.
Reading the recipe in order
Think of a cook with a recipe card. They read it top to bottom: gather the ingredients, mix in this order, bake, then decorate. They don't decorate before the cake exists. There's a sensible sequence.
A browser reads a page much the same way. First it reads the HTML and builds an internal map of the page — every heading, paragraph, and image, in order, like an outline of the whole thing. With the outline in hand, it knows what exists and how the pieces nest inside each other.
Painting and wiring
Once the outline exists, the browser brings in the CSS and applies the looks — colors, fonts, spacing, layout. It figures out exactly where every piece lands and how big it is, then paints the result onto your screen. This is the moment a plain outline becomes the styled page you recognize.
Then it wires up the JavaScript — switching on all the motors so the page can start reacting to your clicks and keystrokes. Outline, then paint, then power: that's the order, and it's why pages sometimes appear in stages. You may glimpse plain text for a blink before the styling snaps in. You just watched the crew work in sequence.
Fetching the missing pieces
Here's a detail that explains a lot. The first file a browser gets is usually just the HTML — and it often mentions other files it needs: a stylesheet over here, three images there, a script up top. So the browser sends out more requests to fetch each one, and slots them in as they arrive.
That's why a page can pop in piece by piece — text first, then a picture, then the final polish. Each piece traveled separately and finished at its own speed. Nothing's broken; you're simply seeing a building assembled as its materials show up at the site.
This same crew builds a Portmint page wherever it loads — a wide desktop, a phone on a train. The instructions describe what to build; the browser builds it to fit the screen it's standing on.
Your turn
Reload a busy website and watch closely for the first half-second. Can you catch the page flash plain for an instant before the styling lands? If you can, you've spotted the browser building — outline first, paint second.
We've built one page and watched it come together. But it's only on your machine. Next, we ask: where does a website actually live so the whole world can visit? 🔦
Stuck or curious?
Ask Pip about this lesson — tap the porthole bottom-right.