HTML <ol>

BrandonDusch's avatar
Published Jul 1, 2022
Contribute to Docs

The <ol> element represents an ordered list of items.

  • Front-end engineers work closely with designers to make websites beautiful, functional, and fast.
    • Includes 34 Courses
    • With Professional Certification
    • Beginner Friendly.
      115 hours
  • Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.
    • Beginner Friendly.
      7 hours

Syntax

<ol>
  <li><!-- Content here --></li>
</ol>

By default, each list item is prepended with a number marker. However, this can be changed to ordered letters or Roman numbers with the type attribute (ideal for legal or technical documentation).

Ordered lists can also appear unordered if a CSS rule like list-style-type: disc; is applied.

Example

<ol>
<li>Preheat oven to 325&deg; F 👩‍🍳</li>
<li>Drop cookie dough 🍪</li>
<li>Bake for 15 min ⏰</li>
</ol>

Each list item appears numbered by default:

Rendered <ol> tag example

All contributors

Contribute to Docs

Learn HTML on Codecademy

  • Front-end engineers work closely with designers to make websites beautiful, functional, and fast.
    • Includes 34 Courses
    • With Professional Certification
    • Beginner Friendly.
      115 hours
  • Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.
    • Beginner Friendly.
      7 hours