LOCK.IN Beginner: your first page on the web
You finish with a page your phone renders.
What is inside
All 6 chapters
1A page is a text file
Read, edit and reload a document the browser turns into a page.
2Structure that means something
Mark up text so a reader and a screen reader get the same outline.
3Styling without guessing
Change colour, type and spacing from a rule you can read back.
4Layout that holds
Place boxes side by side and stack them again on a narrow screen.
5Forms people can use
Build a labelled input that a keyboard, a phone and a screen reader can all drive.
6Put it online
Publish the folder and hand the link to someone else.
Quests and Challenges
- quizThe box model, from memory+15 XP
- repoPublish your first page+10 XP
- bank soalTwenty markup questions+10 XP
Chapter 1: A page is a text file
Read the first chapter
What the browser actually reads
A web page is one text file. The browser reads it from top to bottom and turns every tag it finds into a box on screen. There is no compiler and no build step between you and the result: the bytes you write are the bytes the browser reads.
The panel on this page runs what you type, on your own machine, in a sandboxed frame. Run the two tags below, then change h1 to h2 and run it again. The heading gets smaller because you changed the tag, not because anything was hidden from you.
Every claim in this book is one Run away from proof. When something surprises you, the answer is almost always in the output, not in the prose.
Your first whole document
Two tags are enough to see something, but a document has a shape:
<!doctype html>tells the browser to use today's rules, not a museum copy of the 1990s.<html lang="en">wraps everything and names the language, which is what a screen reader reads first.<head>holds facts about the page: the title in the tab, the character set.<body>holds what a reader sees.
<!doctype html><html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>My first page</title> </head> <body> <h1>My first page</h1> <p>Written by hand, in a browser tab.</p> </body></html><title> never shows up in the body. It shows in the browser tab, in a bookmark, and as the blue line in a search result. A page with no title is a page nobody can find again.
The viewport line is the one that matters on a phone: it tells the browser to lay the page out at the device's real width instead of at a desktop width scaled down, which is why a page without it looks like a poster held at arm's length.
The other 5 chapters
Every interactive code checkpoint, the PDF edition, Quests and Socratic AI.
