HTML Foundations
Build pages that make sense before styling begins. You will learn document structure, meaningful elements, links, media, forms and the accessibility habits that prevent expensive rewrites.
Did Zuckerberg use magic? Start with the browser.
Ever wondered how Facebook was made? What about WhatsApp, Telegram or YouTube? They can feel like magic, but every web interface begins with a browser reading a structure it understands. That first layer is HTML.
HTML means HyperText Markup Language. It is a markup language—not a programming language—and it describes the content and structure of a web page. Every website uses HTML, whether it is a small portfolio, an online shop or a large web application.
No account or special compiler is needed to begin. A text editor and a web browser are enough: save a file as index.html, then open it in the browser. HTML tells the browser what each piece of content is; CSS changes how it looks, and JavaScript changes what it does.
A dependable starting document
<!doctype html>
<html lang="en-KE">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Nairobi Dev Meetup</title>
</head>
<body>
<h1>Nairobi Dev Meetup</h1>
<p>Build, learn and meet other developers.</p>
</body>
</html>
<!doctype html>selects modern HTML behaviour.langtells tools how to pronounce and interpret the page.charsetsupports ordinary text and symbols reliably.- The viewport line lets the layout use a phone's real width.
- A specific
titleidentifies the tab and search result.
Two-minute check
Use the element that matches the job.
Semantic elements communicate purpose. A <button> performs an action; an <a> goes somewhere. A heading introduces a section; it should not be chosen only because its default size looks right.
<header>
<nav aria-label="Primary">
<a href="/events/">Events</a>
<a href="/projects/">Projects</a>
</nav>
</header>
<main>
<article>
<h1>How we run a code clinic</h1>
<p>Bring one bug and explain what you already tried.</p>
</article>
</main>
Four habits with a large payoff
- Keep heading levels logical: an
h2section belongs under the page'sh1. - Write link text that makes sense alone—“Read the CSS guide” is clearer than “click here”.
- Give useful images concise alternative text; use empty
alt=""for decoration. - Connect every form control to a visible
<label>. Placeholder text is not a label.
<form>
<label for="email">Email address</label>
<input id="email" name="email" type="email" autocomplete="email" required>
<button type="submit">Join the meetup</button>
</form>
Why use native elements instead of clickable divs?
Native links, buttons and form controls already provide keyboard behaviour, focus handling and meaning. Rebuilding all of that correctly with generic elements creates avoidable work and accessibility bugs.
A short loop beats passive reading.
For every lesson, spend about ten minutes reading, twenty minutes typing and changing the example, then five minutes explaining the idea without looking. Use the browser inspector and the HTML validator to catch nesting and attribute mistakes.
Learning profile
Structure a complete page with headings, lists and useful links.
Recipe article
Use landmarks, a figure, useful alternative text and ordered steps.
Event schedule
Mark up related timetable data with a caption and clear headers.
Community signup
Build a labelled, grouped and keyboard-usable native form.
Ready to move into CSS?
Recall: what makes HTML “semantic”?
The selected element describes the role of its content, not merely its visual appearance. Meaningful structure helps people and software understand the page.
The complete note goes deeper.
The full authoring pack is complete locally and is being prepared for protected delivery. It will include the remaining explanations, practice checks, all staged projects and the final combined build. Payment is not active yet.
- Document anatomy
- Semantic page structure
- Links and useful media
- Accessible forms
- Metadata and basic SEO
- Validation and final checklist
Primary references reviewed 13 August 2026: MDN: Structuring content with HTML · WHATWG HTML Living Standard · W3C: HTML accessibility. Explanations and examples are original KODE Ń VIBE teaching material.