HTML provides three main types of lists to organize content:
1️⃣ Ordered List (<ol>)
- Displays items in a specific order, usually numbered.
- Each item uses
<li>(list item). - Can customize numbering with
typeattribute (1,A,a,I,i).
Example:
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ol>
Output:
- First item
- Second item
- Third item
2️⃣ Unordered List (<ul>)
- Displays items without a specific order, usually with bullets.
- Each item uses
<li>.
Example:
<ul>
<li>Apple</li>
<li>Banana</li>
<li>Orange</li>
</ul>
Output:
- Apple
- Banana
- Orange
3️⃣ Definition List (<dl>)
- Used for term-definition pairs.
<dt>→ defines the term<dd>→ defines the description
Example:
<dl>
<dt>HTML</dt>
<dd>HyperText Markup Language</dd>
<dt>CSS</dt>
<dd>Cascading Style Sheets</dd>
</dl>
Output:
HTML
HyperText Markup Language
CSS
Cascading Style Sheets
💡 In Short:
<ol>→ ordered (numbers, letters, roman numerals)<ul>→ unordered (bullets)<dl>→ definition lists (term + description)
These lists help organize content clearly and semantically on web pages.