Learning Objectives
By the end of this session, students will be able to:
<html>, <head>, and <body> structure.
<strong>, <em>, <br>, <hr>.
<a> and <img> with proper attributes.
thead, tbody, tfoot, colspan, and rowspan.
Aligned to: CO2 · PO1, PO2
HTML5 Document Structure
The required skeleton of every HTML5 webpage
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 & viewport — charset="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
<div> could hold anything; a <nav> always means navigation.
<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)
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> | |
<sup>/<sub> | Superscript / Subscript — e.g. H2O, x2 — footnotes, chemical formulas |
<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
✔ Use for: shopping lists, features, hobbies, options
<ol> — Ordered List
Numbered list — order matters
✔ Use for: steps, rankings, procedures, instructions
<dl> — Description List
Term + definition pairs
✔ Use for: glossaries, metadata, FAQs, dictionaries
<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"
Links & Images
Connecting pages and embedding visuals with <a> and <img>
🔗 Hyperlinks — <a> tag
href | Destination URL. Can be absolute or relative. |
|---|---|
target | _blank = new tab | _self = same tab (default) |
rel | noopener noreferrer — security best practice for target="_blank" links |
title | Tooltip text shown on hover |
mailto: | <a href="mailto:you@email.com"> — email link |
tel: | <a href="tel:+631234567"> — phone link |
🖼️ Images — <img> tag
src | Path or URL to the image file (required) |
|---|---|
alt | Alternative text — required for accessibility & SEO |
width/height | Hints the browser about dimensions (prevents layout shift) |
loading | lazy = load only when visible (improves performance) |
Absolute:
https://www.google.com (full address, external sites)Relative:
images/photo.jpg (relative to current file, internal links)
HTML5 Tables
Structured data: <table>, <thead>, <tbody>, <tfoot>, colspan & rowspan
<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
profile.html) using ALL elements learned today.
| R1 · 5 pts | HTML5 Document Shell — Correct DOCTYPE, <html lang>, <head> with charset & viewport meta, <body> |
|---|---|
| R2 · 10 pts | Semantic Structure — <header>, <nav>, <main>, at least one <section>, <footer> — 5+ semantic elements |
| R3 · 8 pts | Heading & Biography — <h1> your name, <h2> sections, <p> bio with <strong> and <em> |
| R4 · 7 pts | Two Lists — <ul> of 5 hobbies/interests + <ol> of your top 3 goals |
| R5 · 5 pts | Hyperlinks — External link (target="_blank" + rel="noopener") + mailto: link |
| R6 · 5 pts | Image — <img> with src and descriptive alt attribute (use picsum.photos if no photo) |
| R7 · 8 pts | Class Schedule Table — <table> with caption, <thead>, <tbody>, <tfoot>, colspan used at least once |
| R8 · 2 pts | Footer — <footer> with © HTML entity, your name, and year |
profile.html · Total: 50 points
Key Takeaways
HTML5 Fundamentals: Document Structure · Semantic Elements · Text · Lists · Links · Images · Tables
- Every HTML5 page starts with
<!DOCTYPE html>followed by<html>,<head>, and<body>. - Semantic elements (
<header>,<nav>,<main>,<article>,<section>,<aside>,<footer>) give meaning to structure — not just visual layout. - Use
<strong>and<em>for meaningful emphasis; use<b>and<i>only for visual styling. - HTML has three list types:
<ul>(unordered/bullets),<ol>(ordered/numbered),<dl>(description/glossary). - Always add
alttext to images. Always addrel="noopener"when usingtarget="_blank"on links. - HTML tables use
<thead>,<tbody>,<tfoot>for structure;colspanandrowspanmerge cells. - Validate your HTML at validator.w3.org to catch errors before they reach the browser.