Skip to the workspace
Pebellslearn by building
Document Structure  ›  Capstone Project

Capstone: A Complete Page Skeleton

body 12 minA complete HTML page combines the doctype, a root html with lang, a head with encoding, viewport, title and description, and a body holding the visible content.

html / Capstone: A Complete Page Skeleton

Explore each scene at your own pace.

01 · The rule

The rule

Capstone: A Complete Page Skeleton

A complete HTML page combines the doctype, a root html with lang, a head with encoding, viewport, title and description, and a body holding the visible content.

Assemble a complete document and verify that each part has a clear responsibility.

You now know every piece of the frame that surrounds a web page. In this capstone you assemble them into one skeleton, the starting file you will reuse for every page you build. It is short enough to type from memory, and that is the goal.

The rule

Doctype, root, head for the machine, body for the human.

Here is the full skeleton, filled in for a small community garden page:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Green Lane Community Garden</title>
    <meta name="description" content="Plots, workdays and seed swaps at the Green Lane Community Garden.">
  </head>
  <body>
    <h1>Green Lane Community Garden</h1>
    <p>We grow vegetables, herbs and flowers on shared plots. Everyone is welcome.</p>
    <p>Next workday: Saturday morning. Bring gloves.</p>
  </body>
</html>

Walk it from top to bottom and every line has a reason:

  1. The doctype puts the browser in standards mode.
  2. The root html wraps everything and declares the language.
  3. The head gives the browser the encoding and viewport, and gives people the title and description.
  4. The body holds what the visitor actually reads, starting with one h1 that matches the page's purpose.

The indentation is for you, not the browser: whitespace collapses, so nesting children two spaces deeper simply makes the tree easy to see.

Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.