Chapter 3 — HTML Lists, Links & Images
📚 Chapter Overview
A website without navigation or media is just a document. In this chapter, you will learn how to organize information into lists, connect pages using hyperlinks, and add visual appeal with images.
Learning Objectives:
- Create Ordered (OL) and Unordered (UL) lists.
- Master the Anchor (a) tag for Internal and External links.
- Add and Optimize images with Alt text.
3.1 Ordered and Unordered Lists
Part 1 — Definition
Lists help group related items. Unordered Lists (<ul>) use bullets and are for items where order doesn't matter. Ordered Lists (<ol>) use numbers and are for steps or rankings. Each item in the list is defined by an <li> tag.
Part 2 — Syntax
<ul>
<li>Item 1</li>
</ul>
<ol>
<li>Step 1</li>
</ol>
Part 3 — Example
Problem: Create a simple navigation menu and a task list.
<h3>Menu</h3>
<ul>
<li>Home</li>
<li>About</li>
</ul>
<h3>Ranking</h3>
<ol>
<li>Gold</li>
<li>Silver</li>
</ol>
Part 4 — Video
Video: Coming Soon
3.2 Hyperlinks and Images
Part 1 — Definition
Links (<a>) connect the web. They use the href attribute to specify the destination. Images (<img>) are self-closing tags that use the src attribute to point to a file and alt for accessibility.
Part 2 — Syntax
<a href="https://google.com">Go to Google</a>
<img src="image.jpg" alt="Description">
Part 3 — Example
Problem: Display a logo that links to the home page.
<a href="index.html">
<img src="logo.png" alt="Company Logo" width="100">
</a>
Observation: Wrapping an <img> inside an <a> tag makes the image clickable.
Part 4 — Video
Video: Coming Soon
🏆 Chapter Challenge
Challenge Objective
Build a "Mini Photo Gallery" with descriptive text and navigation.
Requirements
- Create a list of 3 topics.
- Add one image for each topic.
- Link each topic to an external Wikipedia page.
Step-by-Step Process
- Use
<ul>for the gallery structure. - Use
<li>to hold each item (image + text + link). - Ensure all images have
alttext.
Expected Deliverables
gallery.htmlsource file.