Lesson 1 of 12
Structured learning draftBuild a valid HTML document
HTML gives content structure and meaning. A reliable page begins with a complete document skeleton so browsers, search tools and assistive technologies receive the context they need. This lesson pairs implementation with repeatable browser evidence so the learner can explain both the result and its limits.
<header>Neighbourhood study club<main><section>Learn together
Bring one question and a notebook. We meet every Saturday at 10 am.
<section>This week
Build a simple webpage with headings, paragraphs and links.
<footer>A learner-built sample pageSee the layout rule
.demo-cards {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
gap: 1rem;
}
/* Cards fit the available space without a fixed page width. */Learning objectives
- Explain the browser-facing purpose of the document skeleton.
- Create a valid page with language, character encoding, viewport and title metadata.
- Inspect parsing and metadata with developer tools.
Build a valid HTML document
Build a valid HTML document: doctype to head to body.
Explain the browser-facing purpose of the document skeleton.
Create a valid page with language, character encoding, viewport and title metadata.
Inspect parsing and metadata with developer tools.
The doctype selects standards mode. The html element declares the document language. UTF-8 must appear early in head, the viewport declaration lets mobile browsers use the device width, and title supplies the tab and document name.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Amina's design portfolio</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>Amina's design portfolio</h1>
</body>
</html>Verify the document
- Save the file as index.html and open it in a browser.
- Confirm the tab title and document language in developer tools.
- Run the file through the Nu HTML Checker.
- Resize to a narrow viewport and confirm the page uses the device width.
| Evidence | Record |
|---|---|
| Source | The exact HTML and CSS tested |
| Environment | Browser, viewport and input method |
| Result | Observed behavior and test outcome |
| Limitation | Unresolved issue and next action |
Common mistakes
- Omitting the language attribute.
- Putting visible content inside head.
- Using a filename or generic word such as Home for the title.
Practice activity
Apply the lesson
Create a standards-mode document for a one-page portfolio. Validate it and retain a screenshot of the validator result. Submit the source files, test environment, observed result, one failure or boundary case, and a short limitation with the next corrective action.
How to check your work
- Write down the expected result before running or submitting your work.
- Try a normal example, an empty or missing input, and a boundary case where the rule changes.
- Compare the actual result with your prediction. Record the smallest example that explains a difference.
- Explain one change you made and why it improved the result. Save your evidence in the lesson notes.
When you get stuck · webdev
The page works on a laptop but spills sideways on a phone.
- Find the cause
- At a narrow viewport, inspect fixed widths, long unbroken text, images and grid children. Identify the first element wider than its parent.
- Try this
- Replace unnecessary fixed widths with max-width: 100%; allow grid children to shrink with min-width: 0. Keep wide code and tables in their own scroll containers.
- Check the fix
- At 320, 390, 768 and 1440 CSS pixels, the page itself has no horizontal overflow. Keyboard focus and controls stay visible at 200% zoom.
Use this course-wide example when it fits your task. For a different failure, record the input, expected result, actual result and smallest steps that reproduce it.
Watch, pause, practise
Free video lessons
Choose the chapter that matches your task. Videos open on the original provider’s site; playback uses additional data.
Intro to HTML/CSS: making webpages
Follow short explanations alongside editable examples of HTML elements and CSS rules.
Try it yourself: Pause after an example. Recreate it in your own file, then change one rule and explain the result.
Source checked 2026-10-07 · Free learning material; optional certificates may cost extra.Check your understanding
Which combination gives a mobile browser and assistive technology essential document context?
Lesson summary
- A complete skeleton establishes parsing and document context.
- Metadata is functional, not decorative.
- Validation reveals errors browsers may silently repair.
Sources and further reading
- Learn web developmentMDN Web Docs - accessed 2026-09-04
- HTML StandardWHATWG - accessed 2026-09-04
- Page Structure TutorialW3C Web Accessibility Initiative - accessed 2026-09-04
- Web Content Accessibility Guidelines 2.2W3C - accessed 2026-09-04
Personal study note
Your notes
Keep the input, expected result, actual result and what you changed. Save before leaving this lesson. Download a copy to keep it outside this browser.