Learning Objectives

By the end of this session, students will be able to:

LO1 Write a valid HTML5 document with correct DOCTYPE, <html>, <head>, and <body> structure.
LO2 Apply HTML5 semantic elements to give meaningful structure to a webpage.
LO3 Use text formatting tags — headings (h1–h6), paragraphs, <strong>, <em>, <br>, <hr>.
LO4 Create ordered, unordered, and description lists using correct HTML syntax.
LO5 Insert hyperlinks and images using <a> and <img> with proper attributes.
LO6 Build structured HTML tables with thead, tbody, tfoot, colspan, and rowspan.

Aligned to: CO2  ·  PO1, PO2

HTML5 Document Structure

The required skeleton of every HTML5 webpage

Try it Yourself »
Result
DOCTYPE <!DOCTYPE html> — Tells the browser this is an HTML5 document. Must be the very first line — before <html>.
<html> lang="en" attribute — Root element wrapping the entire page. lang helps search engines & screen readers.
<head> Metadata container — Contains info about the page, not visible. Holds <title>, <meta>, <link>, <style>.
<meta> charset & viewportcharset="UTF-8" supports all characters; viewport ensures mobile-responsive display.
<body> Visible content area — Everything users see goes inside <body>: text, images, tables, links.

HTML5 Semantic Elements

Two pages can look identical in a browser — semantic HTML tells machines what each part means

Key insight: Semantic elements describe meaning, not just appearance. A <div> could hold anything; a <nav> always means navigation.
Try it Yourself »
Result
<header>Top of page/section. Contains <h1>, logo, tagline.
<nav>Site navigation links. Usually contains a <ul> of <a> tags.
<main>ONE per page. The dominant, unique page content.
<article>Self-contained content (blog post, news item, product card).
<section>Thematic grouping — should have its own heading.
<aside>Supplementary content: sidebar, related links, ads.
<footer>Bottom of page/section. Copyright, links, contact.

Text Formatting & Headings

Structure and emphasize content with HTML5 text elements

Heading hierarchy (h1–h6)

Heading 1 <h1> · Page Title, ONE per page, highest SEO weight
Heading 2 <h2> · Section headings
Heading 3 <h3> · Sub-section headings
Heading 4 <h4> · Sub-sub-sections
Heading 5 <h5> · Rarely used in practice
Heading 6 <h6> · Lowest level

Inline text elements

<strong>Bold + semantic importance (screen readers announce it)
<em>Italic + semantic emphasis
<b>Bold — visual only, no semantic meaning
<i>Italic — visual only (technical terms, foreign words)
<br>Line break — self-closing, forces a new line within a paragraph
<hr>Horizontal rule — thematic break between content blocks
<small>Smaller text — fine print, disclaimers
<mark>Highlighted text — like a yellow marker
<del>Strikethrough — deleted/removed content
<sup>/<sub>Superscript / Subscript — e.g. H2O, x2 — footnotes, chemical formulas
Try it Yourself »
Result
💡 Best practice: Use <strong> and <em> for meaningful emphasis. Use <b> and <i> only for visual styling with no semantic significance.

HTML5 Lists

Three list types for organizing content

<ul> — Unordered List

Bulleted list — order does not matter

Try it »
Result

✔ Use for: shopping lists, features, hobbies, options

<ol> — Ordered List

Numbered list — order matters

Try it »
Result

✔ Use for: steps, rankings, procedures, instructions

<dl> — Description List

Term + definition pairs

Try it »
Result

✔ Use for: glossaries, metadata, FAQs, dictionaries

🔁 Nested lists: Place a <ul> or <ol> inside a <li> to create sub-items. Browsers auto-indent nested lists. The type attribute on <ol> changes numbering: type="1" (default) · type="A" · type="a" · type="I" · type="i"

HTML5 Tables

Structured data: <table>, <thead>, <tbody>, <tfoot>, colspan & rowspan

Try it Yourself »
Result
<table>Container for the entire table
<caption>Table title — placed inside <table>, above rows
<thead>Groups header rows — for screen readers & CSS targeting
<tbody>Groups data rows — the main table body
<tfoot>Groups footer rows — totals, summaries
<tr>Table row — contains <th> or <td> cells
<th>Header cell — bold, centered by default
<td>Data cell — standard table cell
colspan="N"Merge N cells horizontally
rowspan="N"Merge N cells vertically

Laboratory Activity

My Digital Profile Page  ·  45 minutes  ·  50 points

🖥️ Task: Build a personal HTML5 profile page (profile.html) using ALL elements learned today.
R1 · 5 ptsHTML5 Document Shell — Correct DOCTYPE, <html lang>, <head> with charset & viewport meta, <body>
R2 · 10 ptsSemantic Structure<header>, <nav>, <main>, at least one <section>, <footer> — 5+ semantic elements
R3 · 8 ptsHeading & Biography<h1> your name, <h2> sections, <p> bio with <strong> and <em>
R4 · 7 ptsTwo Lists<ul> of 5 hobbies/interests + <ol> of your top 3 goals
R5 · 5 ptsHyperlinks — External link (target="_blank" + rel="noopener") + mailto: link
R6 · 5 ptsImage<img> with src and descriptive alt attribute (use picsum.photos if no photo)
R7 · 8 ptsClass Schedule Table<table> with caption, <thead>, <tbody>, <tfoot>, colspan used at least once
R8 · 2 ptsFooter<footer> with &copy; HTML entity, your name, and year
💡 Validate your code at validator.w3.org  ·  📁 Save as profile.html  ·  Total: 50 points

Key Takeaways

HTML5 Fundamentals: Document Structure · Semantic Elements · Text · Lists · Links · Images · Tables

  1. Every HTML5 page starts with <!DOCTYPE html> followed by <html>, <head>, and <body>.
  2. Semantic elements (<header>, <nav>, <main>, <article>, <section>, <aside>, <footer>) give meaning to structure — not just visual layout.
  3. Use <strong> and <em> for meaningful emphasis; use <b> and <i> only for visual styling.
  4. HTML has three list types: <ul> (unordered/bullets), <ol> (ordered/numbered), <dl> (description/glossary).
  5. Always add alt text to images. Always add rel="noopener" when using target="_blank" on links.
  6. HTML tables use <thead>, <tbody>, <tfoot> for structure; colspan and rowspan merge cells.
  7. Validate your HTML at validator.w3.org to catch errors before they reach the browser.

▶ Next Week

Week 4: HTML5 Advanced

Forms, Input Types, Validation, Multimedia (Audio, Video, Canvas), ARIA & Accessibility