HTML5 Lists
HTML
What is a list in HTML5?
A list is a way to group related pieces of content together.
HTML5 supports three main types of lists:
- Ordered Lists (
<ol>
) – items are numbered (or lettered). - Unordered Lists (
<ul>
) – items have bullet points. - Description Lists (
<dl>
) – used for pairs of terms and descriptions (like a glossary).
1. Ordered List (<ol>
)
Items are in a specific sequence.
Each item is marked with a number by default.
Output
- First item
- Second item
- Third item You can change the type of numbering (e.g. letters, roman numerals):
2. Unordered List
Items have bullets.
No order implied.
Output
- Apple
- Banana
- Cherry
You can change the bullet style with CSS (circle, square, etc.).
3. Description List
Used for terms and descriptions, like in dictionaries or FAQs.
Syntax:
HTML
A markup language for creating web pages.
CSS
A style sheet language for designing web pages.