Module1 HTML5 LectureNotes
Module1 HTML5 LectureNotes
LECTURE NOTES
Web Technologies
Module 1: HTML5
Structuring, Styling, and Enriching Web Pages with HTML5 and CSS
Instructor: ______________________________
Academic Year: __________
Page 1 of 19
Module 1: HTML5 — Lecture Notes Web Technologies
Table of Contents
Table of Contents.......................................................................................................................................................... 2
Module 1: HTML5 — Overview...................................................................................................................................... 5
Learning Objectives................................................................................................................................................... 5
Suggested Session Plan ............................................................................................................................................. 5
1. Introduction to HTML5 .............................................................................................................................................. 6
1.1 What Is HTML?.................................................................................................................................................... 6
1.2 Understanding HTML Tags................................................................................................................................... 6
1.3 Setting Up the Document Structure ..................................................................................................................... 6
Specifying the Document Type .............................................................................................................................. 6
Creating the HTML Skeleton ................................................................................................................................. 6
Specifying a Page Title .......................................................................................................................................... 6
1.4 Formatting Text by Using Tags ............................................................................................................................. 7
Creating Headings................................................................................................................................................. 7
Applying Bold and Italic Formatting....................................................................................................................... 7
Applying Superscript and Subscript Formatting ..................................................................................................... 7
Using Monospace and Preformatted Text ............................................................................................................. 7
1.5 Using Lists and Backgrounds................................................................................................................................ 7
Creating Bulleted and Numbered Lists .................................................................................................................. 7
Creating Definition Lists ........................................................................................................................................ 7
Inserting Special Characters .................................................................................................................................. 8
Inserting Horizontal Lines ..................................................................................................................................... 8
Choosing Background and Foreground Colors ....................................................................................................... 8
1.6 Creating Hyperlinks and Anchors ......................................................................................................................... 8
Hyperlinking to a Web Page .................................................................................................................................. 8
Creating a Hyperlink to an E-Mail Address ............................................................................................................. 8
Hyperlinking to Other Content .............................................................................................................................. 8
2. Style Sheets and Graphics........................................................................................................................................ 10
2.1 Introduction to Style Sheets .............................................................................................................................. 10
Understanding Styles .......................................................................................................................................... 10
Constructing Style Rules ..................................................................................................................................... 10
Creating Styles for Nested Tags ........................................................................................................................... 10
Applying Styles to Hyperlinks .............................................................................................................................. 10
Creating and Linking to External Style Sheets ...................................................................................................... 10
2.2 Formatting Text by Using Style Sheets ............................................................................................................... 11
Specifying a Font Family...................................................................................................................................... 11
Specifying a Font Size and Color .......................................................................................................................... 11
Applying Bold and Italics, Strikethrough and Underlining..................................................................................... 11
Creating Inline Spans .......................................................................................................................................... 11
Adjusting Spacing Between Letters ..................................................................................................................... 11
2.3 Formatting Paragraphs by Using Style Sheets .................................................................................................... 11
Indenting Paragraphs.......................................................................................................................................... 11
Applying a Border to a Paragraph........................................................................................................................ 11
Page 2 of 19
Module 1: HTML5 — Lecture Notes Web Technologies
Specifying the Horizontal Alignment of a Paragraph ............................................................................................ 12
2.4 Displaying Graphics ........................................................................................................................................... 12
Selecting a Graphics Format................................................................................................................................ 12
Preparing Graphics for Web Use ......................................................................................................................... 12
Inserting Graphics............................................................................................................................................... 12
Arranging Elements on the Page ......................................................................................................................... 12
Controlling Image Size and Padding..................................................................................................................... 12
Hyperlinking from Graphics................................................................................................................................. 12
Using Thumbnail Graphics .................................................................................................................................. 12
Including Alternate Text for Graphics .................................................................................................................. 12
Adding Figure Captions ....................................................................................................................................... 12
3. Page Layout and Navigation .................................................................................................................................... 13
3.1 Creating Navigational Aids................................................................................................................................. 13
Creating a Text-Based Navigation Bar.................................................................................................................. 13
Creating a Graphical Navigation Bar .................................................................................................................... 13
3.2 Creating Tables ................................................................................................................................................. 14
Specifying the Size of a Table .............................................................................................................................. 14
Specifying the Width of a Column ....................................................................................................................... 14
Merging Table Cells ............................................................................................................................................ 14
3.3 Formatting Tables ............................................................................................................................................. 15
Applying Table Borders — Using Attributes ......................................................................................................... 15
Applying Borders by Using Styles ........................................................................................................................ 15
Changing Cell Padding, Spacing, and Alignment................................................................................................... 15
Setting Horizontal and Vertical Alignment ........................................................................................................... 15
4. Creating User Forms ................................................................................................................................................ 16
4.1 Creating a Basic Form ........................................................................................................................................ 16
4.2 Creating a Text Box ........................................................................................................................................... 16
4.3 Special Field Types for E-Mail and Web Addresses ............................................................................................. 16
4.4 Creating a Text Area .......................................................................................................................................... 16
4.5 Creating a Submit or Clear Button ..................................................................................................................... 16
4.6 Creating Check Boxes and Option Buttons ......................................................................................................... 16
Check Boxes (multiple selections allowed) .......................................................................................................... 16
Option (Radio) Buttons (single selection from a group) ....................................................................................... 17
4.7 Additional Input Types in HTML5 ....................................................................................................................... 17
5. Incorporating Sound and Video ............................................................................................................................... 18
5.1 What's New with Audio and Video in HTML5? ................................................................................................... 18
5.2 Embedding Video Clips ...................................................................................................................................... 18
Introducing the <video> Tag ............................................................................................................................... 18
The <embed> Tag: Your Fallback Plan ................................................................................................................. 18
Placing a Video Clip on a Web Page ..................................................................................................................... 18
5.3 Playing Audio with the <audio> Tag ................................................................................................................... 18
Placing an Audio Clip on a Web Page................................................................................................................... 18
Module Summary ....................................................................................................................................................... 19
Page 3 of 19
Module 1: HTML5 — Lecture Notes Web Technologies
Page 4 of 19
Module 1: HTML5 — Lecture Notes Web Technologies
Module 1: HTML5 — Overview
This module builds the foundation for all web development work that follows: the structure, semantics, and formatting
capabilities of HTML5, styling with CSS, tabular and navigational page layout, interactive forms, and native audio/video
embedding. Mastery of this module is a prerequisite for meaningful work with JavaScript, PHP, or any CMS platform (including
WordPress, covered in Module 2).
Learning Objectives
On completion of this module, students will be able to:
● Explain what HTML is and describe the correct structure of an HTML5 document
● Apply HTML tags to format text, including headings, emphasis, superscript/subscript, and preformatted text
● Construct ordered, unordered, and definition lists, and insert special characters and horizontal rules
● Create hyperlinks to web pages, email addresses, and other content types, using absolute and relative referencing
● Explain the purpose of CSS and write style rules, including selectors for nested and linked elements
● Apply CSS properties to format text (font, size, colour, decoration) and paragraphs (indentation, borders, alignment)
● Prepare and insert graphics correctly, including alternate text, captions, and image-based hyperlinks
● Build navigational aids and multi-row/column tables, and format them using both attributes and CSS
● Design and build HTML forms using appropriate input types, including HTML5-specific field types
● Embed audio and video content natively using the <video>, <audio>, and <embed> elements
Page 5 of 19
Module 1: HTML5 — Lecture Notes Web Technologies
1. Introduction to HTML5
<pre>
function greet() {
[Link]("Hello, World!");
}
</pre>
<!-- Relative URL: links to another page within the same site -->
<a href="[Link]">About Us</a>
KEY TERMS
Element An HTML tag together with its content, e.g. <p>Text</p>.
Page 8 of 19
Module 1: HTML5 — Lecture Notes Web Technologies
Attribute Additional information supplied inside an opening tag, e.g. href or src.
Semantic HTML Markup chosen for its meaning (e.g. <strong>, <em>) rather than purely for visual appearance.
Character entity A reserved code (e.g. <) used to display a character that would otherwise be interpreted as
markup.
Anchor The <a> element, used to create hyperlinks to other pages, resources, or locations within the
same page.
Page 9 of 19
Module 1: HTML5 — Lecture Notes Web Technologies
2. Style Sheets and Graphics
/* Example */
p {
color: navy;
font-size: 16px;
}
/* [Link] */
body {
Page 10 of 19
Module 1: HTML5 — Lecture Notes Web Technologies
font-family: Arial, sans-serif;
margin: 0;
}
Instructors should briefly compare units: px (fixed pixels), em (relative to the parent element's font size), and rem (relative to
the root element's font size) — rem is generally recommended for scalable, accessible typography.
.old-price {
text-decoration: line-through;
}
.highlight {
text-decoration: underline;
}
p {
line-height: 1.6;
word-spacing: 3px;
}
Inserting Graphics
<img src="[Link]" alt="Our team at the 2026 conference" width="600" height="400">
[Link]-left {
float: left;
margin-right: 15px;
}
Page 12 of 19
Module 1: HTML5 — Lecture Notes Web Technologies
<figure>
<img src="[Link]" alt="Bar chart showing quarterly sales growth">
<figcaption>Fig. 1 — Quarterly sales growth, 2025–2026</figcaption>
</figure>
KEY TERMS
Selector The part of a CSS rule identifying which HTML element(s) the rule applies to.
Pseudo-class A CSS keyword (e.g. :hover) that selects an element based on a state or interaction, not just its
position in the markup.
External stylesheet A separate .css file linked to one or more HTML pages, enabling shared, reusable, cacheable
styling.
Alt text A textual description of an image's content or purpose, used for accessibility, fallback display,
and SEO.
Vector graphic An image described mathematically (e.g. SVG) rather than as a fixed grid of pixels, allowing
scaling without quality loss.
Page 14 of 19
Module 1: HTML5 — Lecture Notes Web Technologies
</tr>
</table>
table {
border-spacing: 4px; /* space between adjacent cells (ignored if border-collapse: collapse) */
}
Page 15 of 19
Module 1: HTML5 — Lecture Notes Web Technologies
4. Creating User Forms
Attribute Purpose
action The URL the form data is sent to
method GET (data visible in URL, for non-sensitive queries) or POST (data sent in the request body, for
most form submissions)
The <label> element, correctly linked via the matching for/id pair, is essential for accessibility — it increases the clickable area
and allows screen readers to announce the field's purpose.
<label for="website">Website:</label>
<input type="url" id="website" name="website">
Instructors should note that <button> is generally preferred over <input type="submit">/<input type="reset"> in modern
practice, since <button> can contain richer content (icons, styled text) while functioning identically.
Page 16 of 19
Module 1: HTML5 — Lecture Notes Web Technologies
Option (Radio) Buttons (single selection from a group)
<p>Preferred contact method:</p>
<input type="radio" id="contact-email" name="contact" value="email">
<label for="contact-email">Email</label><br>
<input type="radio" id="contact-phone" name="contact" value="phone">
<label for="contact-phone">Phone</label>
A common point of confusion worth addressing directly: radio buttons belonging to the same group must share the same name
attribute so that selecting one deselects the others; checkboxes do not share this constraint since multiple selections are
expected.
<label for="quantity">Quantity:</label>
<input type="number" id="quantity" name="quantity" min="1" max="10">
KEY TERMS
Form An HTML element used to collect user input and submit it to a server.
Label An HTML element associated with a form control, improving accessibility and click target size.
Placeholder Hint text shown inside an input field before the user types, disappearing on input.
Client-side validation Validation performed by the browser (e.g. required, type="email") before data is sent to the
server.
Page 17 of 19
Module 1: HTML5 — Lecture Notes Web Technologies
5. Incorporating Sound and Video
The <audio> element supports the same controls, autoplay, loop, and muted attributes as <video>. As with video, offering
multiple source formats maximizes cross-browser compatibility.
KEY TERMS
Codec A method of encoding/decoding digital audio or video data (e.g. H.264, VP9, MP3, AAC).
<source> A child element of <video>/<audio> offering an alternative file format for the browser to
choose from.
Poster frame A static image displayed in place of a video before playback begins.
Page 18 of 19
Module 1: HTML5 — Lecture Notes Web Technologies
Fallback content Content placed between opening and closing media tags, shown only if the browser cannot
play any provided source.
Module Summary:
This module built a complete foundation in HTML5: document structure and semantic tagging; text formatting both through tags
and CSS; lists, special characters, and hyperlinks; the separation of content (HTML) from presentation (CSS) via style rules,
selectors, and external stylesheets; correct handling of images including accessibility considerations; page layout through
navigation bars and tables; and interactive forms and native audio/video embedding without reliance on third-party plugins.
Instructors are strongly encouraged to pair each section with a short hands-on lab — particularly forms and tables, which are
best absorbed through direct construction and troubleshooting of markup rather than lecture alone. A cumulative lab exercise
(e.g. building a simple multi-page personal portfolio site using every element covered in this module) is an effective capstone
activity before moving to Module 2.
Page 19 of 19