Build a portfolio of HTML5 & CSS3 pages — one task at a time
Grade XI • Computer Science ⏱️ ~25 min/sessionBrief Intro — Web Technology I
Reading about HTML and CSS is one thing — using them is another. In this lab you move from theory to practice by building 15 real HTML files, one brief at a time, just as a working web developer would.
You already know HTML5 structure and CSS rules from the previous two activities. Here you apply that knowledge to create pages with headings, lists, tables, forms, images, audio, video, SVG, and finally your own styled portfolio page.
How this lab works
Prerequisites
webtech-lab/ on your computer to save all your work.Brief 1 — HTML5 Skeleton
Create task1.html containing a complete, valid HTML5 document.
<!DOCTYPE html>, <html lang="en">, <head>, and <body>.<head>, add a <title> that reads "My First Page".<body>, add an <h1> with "Hello World!" and a <p> with "I am learning web development."<meta charset="UTF-8"> tag inside <head>.Verify your work: Open the file in a browser. Does the tab show "My First Page"? Can you see both the heading and the paragraph?
Stretch: Validate your page at validator.w3.org. Fix any errors.
<title> belongs in <head>, not <body>. The <h1> and <p> belong in <body>. Every HTML5 document starts with <!DOCTYPE html>.Brief 2 — Headings & Paragraph Alignment
Create task2.html that demonstrates all six heading levels and three paragraph alignments.
<h1> through <h6> in order. Each heading should have a short descriptive text.<hr> elements.style attribute with text-align.<br> to break a line mid-sentence. Observe the effect.This paragraph is centre-aligned.
Verify your work: Does the page show progressively smaller headings from h1 to h6? Are the three paragraphs aligned differently?
Stretch: Also try the deprecated align attribute on one paragraph. Compare the result — both work, but style is the modern approach.
<p style="text-align: center;">...</p> to centre a paragraph. The <hr> tag creates a horizontal rule (thematic break) and does not need a closing tag.Brief 3 — Formatting Tags & Attributes
Create task3.html that showcases text formatting tags, the title attribute, and HTML comments. Hover over this abbreviation to see a live demo of the title attribute.
<b>, <i>, <strong>, <em>, <mark>, <small>, <del>, <ins>, <sub>, <sup>.title attribute to an <abbr> element and to a <p> element to show tooltips on hover.<!-- Subscript and Superscript -->).<br> to separate formatting examples within a single paragraph.Bold, italic, strong, emphasised, marked, small, deleted, inserted, H2O (subscript), E=mc2 (superscript).
Verify your work: Hover over the elements with title attributes — do tooltips appear? View the page source (right-click → View Page Source) — are your comments visible?
Stretch: What is the difference between <b> and <strong>? Between <i> and <em>? Write your answer as an HTML comment in the file.
<!-- This text is invisible in the browser -->. Tooltip: <p title="This is a tooltip">Hover over me</p>. Subscript: H<sub>2</sub>O. Superscript: E=mc<sup>2</sup>.Brief 4 — Links & Images
Create task4.html containing hyperlinks and embedded images.
https://www.google.com that opens in the same tab (default).target="_blank".photo.jpg) with width="200" and height="150". Include alt text.Verify your work: Does clicking the image take you to Google? Does the absolute URL image actually display (check the URL is valid)?
Stretch: Add a title attribute to the image link so a tooltip appears on hover.
<a href="https://google.com"><img src="photo.jpg" width="200" height="150" alt="Photo"></a>. For target="_blank", add the attribute to the <a> tag.Brief 5 — Lists
Create task5.html that uses all three HTML list types with various styles.
type="square" for the bullet style.type="A" for capital-letter numbering.Verify your work: Count the list types. Are there three distinct types? Does the nested list appear indented correctly under its parent item?
Stretch: Add a start="5" attribute to an ordered list and observe the effect. Research what reversed does.
<ul type="square"><li>Item</li></ul>. Ordered with letters: <ol type="A">. Definition: <dl><dt>Term</dt><dd>Definition</dd></dl>. Nesting: put a <ul> inside an <li>.Brief 6 — Tables
Create task6.html that builds a weekly class timetable.
<th> for the header row and for the first column (day labels).colspan (e.g., a lunch break spanning two periods).rowspan (e.g., a double-period subject spanning two rows).<caption> that reads "Weekly Class Timetable".| Day | Period 1 | Period 2 | Period 3 |
|---|---|---|---|
| Mon | Maths | Science | English |
| Tue | Lab (colspan=2) | CS | |
Verify your work: Do merged cells span correctly? Does the <caption> appear above the table? Is the table readable?
Stretch: Add a border="1" attribute to the <table> tag and a bgcolor attribute to the header row. (These are deprecated but still work.)
<td colspan="2">Lunch Break</td>. Rowspan: <td rowspan="2">Double Maths</td>. A cell with rowspan pushes content in the column below it to the next column.Brief 7 — Forms
Create task7.html — a student registration form that collects the following using proper form elements:
<input type="text">)<input type="email">)<input type="password">)<input type="date">)<input type="radio"> — Male / Female / Other)<input type="checkbox"> — at least 4 checkboxes)<select> with <option>s — Grade 9 through 12)<textarea> with 4 rows)Every input must have an associated <label> with a for attribute. Group radio buttons with the same name so only one can be selected at a time.
Verify your work: Click the label text — does it focus the corresponding input? Can you select only one gender radio button at a time? Does the Reset button clear all fields?
Stretch: Add required to the name and email fields. Try submitting without filling them — what happens?
<label for="name">Full Name</label><input type="text" id="name" name="name">. The for attribute must match the id of the input. Radio buttons share the same name to form a group.Brief 8 — Login Page
Create task8.html — an attractive login page that introduces basic CSS styling.
<div> container with margin: auto and a fixed width.border-radius), and a light background colour using inline CSS.background-color, color, padding).Verify your work: Is the form centred horizontally on the page? Does the Login button have a distinct style from the Cancel button?
Stretch: Add a <link> to an external stylesheet even though you are not using it yet — prepare for Session 4.
<div style="width: 350px; margin: auto; border: 2px solid var(--secondary-color); border-radius: 10px; padding: 20px; background: var(--bg-color);">. Styled button: <input type="submit" value="Login" style="background: var(--secondary-color); color: white; padding: 10px 20px; border: none; border-radius: 5px;">.Brief 9 — Audio & Video
Create task9.html that embeds audio and video players with multiple source formats.
<audio controls> element with muted and loop attributes. Include two <source> elements with src and type (e.g., audio/mpeg, audio/ogg).<video controls> element with width="480" and height="320". Include a poster attribute pointing to a placeholder image URL.<source> elements (video/mp4, video/webm).Verify your work: Do the audio and video controls appear? Is the poster image visible before you click play? What happens when you hover over the audio element — does it loop?
Stretch: Use the <track> element inside video to specify a subtitles file (you can reference a fictional subtitles.vtt file).
<audio controls muted loop><source src="song.mp3" type="audio/mpeg"><source src="song.ogg" type="audio/ogg">Your browser does not support audio.</audio>. The browser uses the first source format it supports.Brief 10 — Embedding & Iframe
Create task10.html that embeds external content using <iframe>, <embed>, and <canvas>.
https://en.wikipedia.org) in an <iframe> with width="800" and height="400". Add the sandbox attribute to restrict form submission and script execution.<canvas> element with id="myCanvas", width="400", height="200". Leave it blank — it will appear as an empty rectangle.Verify your work: Does the Wikipedia page load inside the iframe? Is the canvas visible as an empty box? (Some websites block iframe embedding for security — that is expected behaviour.)
Stretch: Use JavaScript in the browser console (F12 → Console) to draw a blue rectangle on the canvas: document.getElementById('myCanvas').getContext('2d').fillStyle = 'blue'; document.getElementById('myCanvas').getContext('2d').fillRect(50, 50, 100, 80);
<iframe src="https://en.wikipedia.org" width="800" height="400" sandbox></iframe>. Canvas: <canvas id="myCanvas" width="400" height="200" style="border: 1px solid black;"></canvas>. The border helps you see the canvas boundaries.Brief 11 — SVG Graphics
Create task11.html that draws five distinct shapes using inline SVG.
<svg width="500" height="400"> container.cx="80", cy="80", r="50". Fill it with blue, stroke with dark blue.x="200", y="50", width="100", height="70". Fill with green, stroke with dark green, stroke-width="3".cx="400", cy="80", rx="60", ry="30". Fill with orange, opacity="0.6".(50, 200) to (200, 300) with stroke="red" and stroke-width="4".points="250,200 350,300 150,300". Fill with purple, opacity="0.5".Verify your work: Are all five shapes visible? Does the circle overlap with any other shape? Are the opacity values working — can you see through the transparent shapes?
Stretch: Add a <text> element inside the SVG to label each shape. SVG text uses <text x="..." y="...">Label</text>.
<svg> tag. Circle: <circle cx="80" cy="80" r="50" fill="blue" stroke="darkblue" />. Polygon: <polygon points="250,200 350,300 150,300" fill="purple" opacity="0.5" />. The points attribute is pairs of x,y coordinates.Use this playground to experiment with CSS properties before applying them to your pages in Session 4. Adjust the controls below and watch the preview update in real time.
Brief 12 — Internal CSS
Create task12.html styled entirely through an internal <style> block in the <head>.
<h1> elements: color: var(--secondary-color), text-align: center, font-family: Arial, sans-serif.<p> elements: font-size: 18px, color: var(--text-color), line-height: 1.6.<div> with id="highlight": background-color: var(--warning-color), padding: 15px, border-radius: 8px, color: white.<a> elements: remove underline (text-decoration: none), change colour to var(--secondary-color).class="container" on a <div> that wraps all content: max-width: 800px, margin: auto, padding: 20px.Verify your work: Are all h1 elements blue and centred? Does the highlighted div have rounded corners? Are links underlined — or not?
Stretch: Add a :hover pseudo-class for links that changes their colour when the mouse is over them.
Brief 13 — External CSS
Create two files: style.css (external stylesheet) and task13.html (page that links to it).
style.css, write rules for:
body: background-color: var(--bg-color), font-family: 'Segoe UI', Tahoma, sans-serif, color: var(--text-color). h1: color: var(--primary-color), text-decoration: underline, text-align: center. .highlight: background-color: yellow, font-weight: bold, padding: 5px, border-radius: 3px. .card: border: 1px solid var(--border-color), padding: 15px, margin: 10px 0, border-radius: 8px, background: var(--card-bg).task13.html, link to style.css using <link rel="stylesheet" href="style.css">.<div class="card"> sections, each with an <h2> and a <p>. Use <span class="highlight"> on a keyword in each paragraph.Verify your work: Open task13.html — do the styles from style.css apply? Change the body background colour in style.css to lightblue and refresh — does it update without touching the HTML?
Stretch: Add a second CSS file (extra.css) that overrides the h1 colour. Link it after style.css. Which colour wins? Why?
Brief 14 — CSS Priority & Box Model
Create task14.html that demonstrates cascading priority and the box model on a single page.
green via external CSS (link to style.css from Brief 13), orange via an internal <style> block, and purple via inline style attribute. Which colour wins in the browser?<div>: margin: 40px, background: var(--bg-light)<div>: border: 5px dashed var(--secondary-color), padding: 30px, background: var(--card-bg)<div>: padding: 20px, background: var(--warning-color), color: white, text-align: center<div>: "Content Area"background-color using inline or internal CSS.Verify your work: Is the paragraph purple (inline wins)? In the box model demo, measure the spacing — can you see margin (outer), border (middle ring), padding (inner ring), and content (centre)?
Stretch: Right-click the box model <div> → Inspect. In the browser's developer tools, view the computed box model diagram. Does it match your expected margin/border/padding values?
color on the same paragraph, inline wins. For the box model, think of nesting like Russian dolls — each layer wraps the one inside it.Capstone Project — Personal Profile Page
Create profile.html — a single personal profile page that integrates everything you have learned. This is your final and most important deliverable.
Requirements:
<!DOCTYPE html>, lang="en", <meta charset="UTF-8">, and a descriptive <title>.profile.css) that you create yourself. All styling must come from this file — no inline or internal styles except where explicitly noted.<div> or semantic HTML5 tag (<header>, <section>, <footer>):
<h1>, a tagline as <p>.<strong>, <em>, etc.) and a title attribute on a word.<a href="#section-id">.profile.css, demonstrate:
margin, padding, border on sections.max-width container centered with margin: auto.Verify your work: Open profile.html in a browser. Does the navigation jump to the correct sections? Is the table properly formatted? Does the form have all required fields? Validate your HTML at validator.w3.org — aim for zero errors.
Stretch: Add a <meta name="description"> tag for SEO. Embed a Google Maps iframe showing your city. Use CSS to create a two-column layout for the Skills and Hobbies sections using display: inline-block or float.