Objective. Students create valid HTML5 documents using correct DOCTYPE, head metadata, and semantic structural elements including header, nav, main, section, article, aside, and footer.
This lesson, its worked examples and its practice questions has not yet been verified by an industry-certified professional or by a certification or approval body. It is a study draft and may contain errors. Do not use it as instructions for work on a job site or on live equipment. Always follow your instructor, your supervising professional, and current official references and regulations.
VoTechWorks program approval and accreditation are still in progress. Credentials are issued only by the certifying bodies named in each program, after their own exams.
Every webpage begins as a plain-text file that a browser parses and renders into the visual page you see. HTML5 is the current standard for that file format, maintained by the World Wide Web Consortium (W3C) and the Web Hypertext Application Technology Working Group (WHATWG). A valid HTML5 document follows a precise structure so that browsers, search engines, and assistive technologies can all interpret it correctly.
The very first line of any HTML5 document must be the DOCTYPE declaration:
```html
<!DOCTYPE html>
```
This single line tells the browser to render the page in standards mode rather than the legacy "quirks mode" used for old, pre-standards pages. It is not an HTML tag; it is an instruction to the browser. Omitting it can cause subtle rendering differences across browsers.
After the DOCTYPE, every HTML5 document contains three nested parts:
The `<head>` section should always include at minimum:
```html
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Page Title</title>
```
Semantic HTML means using elements that describe the meaning or role of their content, not just its appearance. Before HTML5, developers often built entire layouts using only `<div>` and `<span>` tags — generic containers with no inherent meaning. This made it difficult for screen readers used by people with disabilities, for search-engine crawlers, and for other developers reading the code.
HTML5 introduced a set of semantic structural elements that replace those meaningless divs with tags whose names explain their purpose.
| Element | Purpose |
|---|---|
| `<header>` | Introductory content for the page or a section; often holds a logo and site title |
| `<nav>` | A block of navigation links |
| `<main>` | The primary, unique content of the page; should appear only once per page |
| `<section>` | A thematically grouped block of content, typically with its own heading |
| `<article>` | Self-contained content that could stand alone, such as a blog post or news story |
| `<aside>` | Content tangentially related to the main content, such as a sidebar or pull quote |
| `<footer>` | Closing content for the page or section; often holds copyright and contact info |
A single page can contain multiple `<section>`, `<article>`, and `<aside>` elements where appropriate, but only one `<main>`.
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My First Semantic Page</title>
</head>
<body>
<header>
<h1>My Website</h1>
<nav>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#about">About</a></li>
</ul>
</nav>
</header>
<main>
<section>
<h2>Welcome</h2>
<article>
<h3>Latest Post</h3>
<p>Content goes here.</p>
</article>
</section>
<aside>
<p>Related links and resources.</p>
</aside>
</main>
<footer>
<p>© 2025 My Website</p>
</footer>
</body>
</html>
```
The W3C Markup Validation Service at validator.w3.org checks your HTML against the official specification. You can paste your code directly, upload a file, or provide a URL. The validator reports errors (which break conformance) and warnings (which are advisory). Your goal is zero errors before submitting any lab work. Common errors include missing `alt` attributes on images, unclosed tags, and elements placed outside their allowed parent.
Web development work is office and lab work. Physical hazards are low but real:
VS Code is the industry-standard code editor you will use throughout this program. The Live Server extension automatically refreshes your browser every time you save a file, so you see changes instantly without manually reloading. Right-click your HTML file in the VS Code Explorer panel and choose Open with Live Server to start it. Changes appear in Chrome in real time.
Answer each question, then check it. Nothing is recorded; this is your own practice.
A free tech program — complimentary, as our commitment to get America working. Help us build VoTechWorks. Tell us what works, what doesn’t, and what you want to learn.