20 min read
Your First Web Page
The basic structure every HTML document needs: doctype, html, head, meta, title and body — saved as index.html.
The Page Template
Every HTML page starts with the same skeleton. Kasun creates index.html in the ceylonleaf folder and types:
index.htmlHTML
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Home | Ceylon Leaf Tea Room, Galle</title></head><body> <h1>Welcome to the Ceylon Leaf Tea Room</h1> <p>Fresh Ceylon tea and homemade cakes in the heart of Galle Fort.</p></body></html>What the browser shows
Line by Line
| The parts of the template | |
|---|---|
Save and Open
- Save the file as index.html inside your site folder (Ctrl + S).
- Open the folder in File Explorer and double-click index.html — it opens in your browser.
- Change something in VS Code, save, then refresh the browser (F5) to see it.
Head vs Body
Practice
Where does the main heading of the page go?
More lessons in HTML · Next: Elements, Tags and Attributes · Previous: Introduction
