freecoding.school100% FREE · NO SIGNUP
Markup CityISSUE #4 of 39

the smallest valid page

Tagg the BuilderVSThe Unclosed Tag
Tagg the Builder saysA valid page needs a doctype, an <html> root, a <head> for metadata, and a <body> for what you see.

Every HTML document shares the same skeleton. <!doctype html> tells the browser to use modern standards mode. <html> wraps everything. <head> holds metadata the user doesn't see directly — title, charset, links. <body> holds everything that shows on screen.

Memorize this shape. You'll type it (or let your editor scaffold it) at the start of every page you ever build. Add lang="en" to the html tag for accessibility and search.

Power-ups you unlock

The Unclosed Tag attacks — common mistakes

Boss battleDelete the <!doctype html> line and reload. Most modern layouts still work, but you have opted into quirks mode — a habit worth never forming. Put it back.

Example code

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width,initial-scale=1">
  <title>the skeleton</title>
</head>
<body>
  <h1>every page starts like this</h1>
</body>
</html>
▶ Open the interactive comic issue
‹ Picking An Editor That Won'T Fight YouElements · The Building Bricks ›