PLAN-101 Career OS
Beginner 35 Minutes

Semantic HTML, Accessible Forms & Document Structure

Learn to structure real web pages with meaningful HTML landmarks, labels, headings and accessible forms, then prove your knowledge with a short quiz and mini-project.

Key Learning Objectives

  • Choose semantic page regions instead of building every section with div elements.
  • Associate form controls with accessible labels and appropriate input types.
  • Distinguish headings, buttons and links by meaning rather than appearance.
  • Build a keyboard-friendly portfolio contact page with valid document structure.

A document is a meaningful outline, not just a visual layout

A semantic HTML document describes what each region and element means. Use header for introductory content, nav for site navigation, main for the dominant page content, section for thematic groups with headings, article for independent items, and footer for closing information. Most pages should have one main landmark. Headings should describe the hierarchy of ideas, not be chosen merely for visual size. A div remains appropriate for purely presentational wrappers.

<!doctype html>
<html lang="en">
<head><meta charset="utf-8"><title>Student portfolio</title></head>
<body>
  <header><h1>My engineering portfolio</h1></header>
  <nav aria-label="Main navigation"><a href="#projects">Projects</a></nav>
  <main><section id="projects"><h2>Projects</h2><article><h3>Study planner</h3><p>A task management project.</p></article></section></main>
  <footer><p>Contact me</p></footer>
</body>
</html>

Landmarks help assistive technology navigate a page, while h1–h3 establish a logical content hierarchy.

Forms and controls must communicate their purpose

A form field needs an accessible name. The simplest method is a visible label with a for attribute matching the input id. Use input types such as email to communicate constraints and enable suitable mobile keyboards. Use button for actions and a for navigation. Required fields should use the required attribute, and errors should explain how the user can fix the problem. Avoid relying on placeholder text as the only label.

<form action="/contact" method="get">
  <label for="student-email">Email address</label>
  <input id="student-email" name="email" type="email" autocomplete="email" required>
  <button type="submit">Send enquiry</button>
</form>

The label remains visible and clickable, and the email field benefits from built-in browser validation.

Build It: Build an accessible student portfolio contact page

Create a single HTML document with clear navigation, a project section and a working, correctly labeled contact form.

Project Deliverables

  • One valid HTML5 page with header, nav, main and footer.
  • A project article with appropriate heading hierarchy.
  • A form with explicit labels, email validation and a submit button.

Acceptance Criteria

  • All form controls have visible associated labels.
  • Every interactive element is reachable with the Tab key.
  • The page has a meaningful title and one main landmark.

Next Steps & Related Learning

This interactive lesson is part of the Frontend Developer curriculum. Continue exploring or try another interactive lesson:

View Full Frontend Developer → Arrays, Contiguous Memory & Hash Tables → JavaScript Asynchronous Execution & V8 Event Loop → Relational Database Architecture, B-Trees & Query Optimization → Python Functions, Dictionaries and Reliable Data Processing → SQL Joins, Missing Rows and Query Correctness → React State, Events and Derived UI → Designing a Task API: HTTP Methods, Errors and Validation → Sliding Window: From Quadratic Loops to a Linear Scan → Responsive CSS Layout: Flexbox, Grid and Fluid Constraints → TypeScript Union Types and Runtime Narrowing → Docker Images, Containers and Reproducible Builds → Git Branches, Pull Requests and Conflict Resolution → Graph Traversal: BFS, DFS and Visited Sets → AWS IAM: Least Privilege and Secure Cloud Access → API Pagination, Error Contracts and Safe Retries →