HTML Lists

HTML Lists
HTML lists are used to group related items in a structured way. There are three main types of lists in HTML:
Unordered List (
<ul>)Ordered List (
<ol>)Description List (
<dl>)
1. Unordered List (<ul>)
An unordered list displays items with bullets.
Change Bullet Style
Common styles: disc (default), circle, square, none
2. Ordered List (<ol>)
An ordered list displays items in a numbered order.
Change Number Type
Types:
1→ NumbersA→ Uppercase lettersa→ Lowercase lettersI→ Roman (uppercase)i→ Roman (lowercase)
3. Description List (<dl>)
A description list is used for terms and definitions.
<dt>→ Term<dd>→ Description
4. Nested Lists (List Inside List)
5. Horizontal List (Using CSS)
Used commonly for navigation menus.
Comparison Table
| List Type | Tag | Use Case |
|---|---|---|
| Unordered | <ul> | Bullet points |
| Ordered | <ol> | Steps / ranking |
| Description | <dl> | Definitions |
Best Practices
- Use
<ul>for menus - Use
<ol>for steps or sequences - Use
<dl>for definitions - Don’t use lists only for spacing (use CSS)
