Chapter 1 of ?
html 8 min read

HTML Mastery — Chapter 4: Formatting, Colors & Typography

Lists — ul, ol, dl & All Attributes

HTML provides three types of lists: unordered, ordered, and description lists. Each has unique attributes and nesting capabilities.

Unordered List <ul>

Creates a bulleted list where order doesn't matter. Items use <li> tags.

<ul> <li>HTML</li> <li>CSS</li> <li>JavaScript</li> </ul>
  • HTML
  • CSS
  • JavaScript

Ordered List <ol> — All Attributes

Creates a numbered list where sequence matters. Supports several powerful attributes:

AttributeValuesEffect
type1 (default numbers), A (uppercase letters), a (lowercase letters), I (uppercase Roman), i (lowercase Roman)Changes the counter style for all list items.
startInteger (e.g., 3)Starts the list at a specific number. Useful when splitting a list across content.
reversedBoolean (no value needed)Counts items in reverse order (10, 9, 8… down to 1).

type="A" start="3"

  1. First item (C)
  2. Second item (D)
  3. Third item (E)

type="I" reversed

  1. Third
  2. Second
  3. First

<li> List Item Attributes

AttributeApplies toPurpose
value<li> inside <ol>Overrides the counter for this specific item and all following items. E.g., <li value="10"> starts counting from 10.
  1. Item 1
  2. Item 5 (jumped!)
  3. Item 6 (auto)
  4. Item 7 (auto)

Nested Lists

Lists can be nested inside each other by placing a new list inside an <li>:

<ol> <li>Front-End <ul> <li>HTML</li> <li>CSS</li> </ul> </li> <li>Back-End <ul> <li>Node.js</li> </ul> </li> </ol>
  1. Front-End
    • HTML
    • CSS
  2. Back-End
    • Node.js

Description List <dl>

A semantic list of term-definition pairs. Used for glossaries, metadata, FAQ sections. No <li> — uses <dt> (term) and <dd> (definition).

TagPurpose
<dl>Description list container.
<dt>Description term — the word or name being described. Can have multiple <dt> for one <dd>.
<dd>Description details — the definition or value. Can have multiple <dd> for one <dt>. Indented by browsers by default.
<dl> <dt>HTML</dt> <dd>HyperText Markup Language</dd> <dt>CSS</dt> <dd>Cascading Style Sheets</dd> <dt>JS</dt> <dd>JavaScript</dd> </dl>
HTML
HyperText Markup Language
CSS
Cascading Style Sheets
JS
JavaScript
CSS Tip: Control list appearance with CSS:
  • list-style-type: none — removes bullets/numbers
  • list-style-type: square — square bullets
  • list-style-image: url(icon.svg) — custom image as bullet
  • list-style-position: inside — wraps text under bullet

Chapter Summary

  • <ul> for unordered lists; <ol> for ordered/numbered lists
  • <ol> supports type, start, and reversed attributes
  • <li value="N"> overrides the counter for ordered lists
  • <dl> + <dt> + <dd> creates glossaries and definition pairs
  • Lists can be nested to any depth by placing a new list inside an <li>
Done with this chapter?
Mark it complete to track your progress and unlock your certificate.
Next Up

Learner Reviews

Write a Review
Share your experience to help other learners.
Your Rating *