recipe.htmlrecipe.htmlCold brewSlow, smooth coffee.CoffeeWaterSteps1.Mix2.Wait 12 hours1<h1>Cold brew</h1>2<p>Slow, smooth coffee.</p>3<ul>4 <li>Coffee</li>5 <li>Water</li>6</ul>7<h2>Steps</h2>8<ol><ul>9 <li>Mix</li>10 <li>Wait 12 hours</li>11</ol></ul>h1Cold brewh2Steps<h1><p><ul><li><li><h2><ol><li><li>
Left: the HTML file (headings, a paragraph, two lists) and the page's outlineBack right: the browser, which draws each block on the pageChips: each tag travelling from its line to the block it becomesLeft: recipe.html, eleven lines of HTML on a card. In front of it: the page's outline, h1 then h2. Back right: a web browser. As the browser reads each element, tag chips hop from the card to the page and the block appears: a big heading, a paragraph whose three spaces collapse to one, a bulleted list, a smaller heading and a numbered list. Last, ol becomes ul on lines 8 and 11, and the numbers turn into bullets. The browser reads the whole file and draws the page almost at once. The figure draws one element per step so you can follow it.

Headings and paragraphs

  1. Most text on a web page is headings, paragraphs and lists. Each is a block element: it starts on a new line and takes the full width. This file uses all three to make a small recipe page.

Lists and sections

Meaning, not looks

What happens

;; step 1/9 · blocks
file     recipe.html   (11 lines: the page's body)
blocks   h1, h2   headings
         p        a paragraph
         ul, ol   lists, holding li items
block    starts on a new line, full width

The card shows only what goes inside <body>. A full page wraps it in <!DOCTYPE html>, <html>, <head> (with a <title>) and <body>. The browser reads the whole file and draws the page almost at once. The figure draws one element per step so you can follow it.