HTML Lists
> Create unordered, ordered, nested, and description lists for structured information.
**Cyber Code Academy · HTML Tutorial · Lesson 10 · Beginner**
## 1. Why lists are useful
Lists group related information. They are common in navigation menus, course outlines, instructions, feature lists, and definitions.
HTML offers three main list structures:
1. Unordered list: ul.
2. Ordered list: ol.
3. Description list: dl.
## 2. Unordered lists
Use ul when the sequence is not important.
“`html
Frontend technologies
- HTML
- CSS
- JavaScript
“`
The browser usually displays bullet markers. CSS can change the list appearance, but keep the list semantics.
## 3. Ordered lists
Use ol when the order is important, such as steps in a process.
“`html
How to create a web page
- Create a project folder.
- Create index.html.
- Write the HTML structure.
- Save and open it in a browser.
“`
### Ordered list attributes
The start attribute sets the starting number:
“`html
- Fifth step
- Sixth step
“`
The reversed attribute counts down:
“`html
- Three
- Two
- One
“`
The type attribute can choose numbering style, such as 1, A, a, I, or i. Use CSS list-style properties when the goal is only visual styling.
## 4. Nested lists
A nested list represents a sub-list of an item. Put the child list inside the relevant li element.
“`html
- Frontend
- HTML
- CSS
- JavaScript
- Backend
- Node.js
- Databases
“`
The nested items belong to their parent item.
## 5. Description lists
A description list represents terms and their descriptions.
“`html
- HTML
- Structures the content of web pages.
- CSS
- Controls visual presentation and layout.
- JavaScript
- Adds behaviour and interactivity.
“`
– dl is the description list.
– dt is a term or name.
– dd is the description or value.
It is useful for glossaries, metadata, and term-definition pairs.
## 6. Lists in navigation
Lists are often used inside nav elements:
“`html
“`
Using a list communicates that the links are a group of related navigation items.
## 7. Common mistakes
– Writing li elements outside ul or ol.
– Using an ordered list when sequence does not matter.
– Using a description list for arbitrary layout.
– Placing nested lists outside the parent li.
– Creating manual bullets with text symbols instead of using list elements.
## 8. Practice exercises
1. Create an unordered list of ten HTML topics.
2. Create an ordered list explaining how to save and preview an HTML page.
3. Create a nested list of frontend and backend technologies.
4. Create a description list defining HTML, CSS, DOM, and URL.
5. Create a navigation menu using nav, ul, li, and a.
## 9. Knowledge check
1. How is ul different from ol?
2. What does li represent?
3. How do you start numbering from 5?
4. Where should a nested list be placed?
5. What are dt and dd used for?
6. Why are lists useful for navigation?
**Next lesson:** HTML Tables.
Want to learn this professionally?
Explore practical IT training at Cyber Code Academy.
View Academy Courses