Lab Activity: Web Technology I

Build a portfolio of HTML5 & CSS3 pages — one task at a time

Grade XI • Computer Science ⏱️ ~25 min/session

Brief 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

Objectives What You Will Build
Session 1 HTML Document Structure & Basic Tags

Brief 1 — HTML5 Skeleton

Create task1.html containing a complete, valid HTML5 document.

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.

Hint
The <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.

Live demo — heading sizes:

h1 Heading

h2 Heading

h3 Heading

h4 Heading

h5 Heading
h6 Heading

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.

Hint
Use <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.

Live demo — formatting tags:

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.

Hint
Comments: <!-- 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.

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.

Hint
To make an image clickable, wrap it in an anchor tag: <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.
Session 2 Lists, Tables & Forms

Brief 5 — Lists

Create task5.html that uses all three HTML list types with various styles.

Unordered:
  • HTML
  • CSS
  • JavaScript
Ordered:
  1. Plan
  2. Build
  3. Test
Definition:
HTML
Structure
CSS
Style

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.

Hint
Unordered: <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.

Live demo — table with colspan:
DayPeriod 1Period 2Period 3
MonMathsScienceEnglish
TueLab (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.)

Hint
Colspan: <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:

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?

Hint
Label with for: <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.

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.

Hint
Centred container: <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;">.
Session 3 HTML5 Multimedia & Graphics

Brief 9 — Audio & Video

Create task9.html that embeds audio and video players with multiple source formats.

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).

Hint
Audio structure: <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>.

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);

Hint
Iframe with sandbox: <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.

Live demo — SVG shapes:

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>.

Hint
SVG shapes go inside the <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.
Reference Tool CSS Playground

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.

Live Preview:
Sample Text
Session 4 CSS Styling & Capstone Project

Brief 12 — Internal CSS

Create task12.html styled entirely through an internal <style> block in the <head>.

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).

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.

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?

Hint
Inline > Internal > External > Browser default. If all three set 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:

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.