How to Style an Ordered List with uppercase Roman Numbers in CSS

Learn how to style an ordered list with uppercase roman numbers in CSS.

To make an ordered list in HTML, you use:

  • The <ol> tag to define your ordered list element.
  • The <li> tag to define your list item elements.

Example:

<ol>
  <li>List item</li>
  <li>List item</li>
  <li>List item</li>
</ol>

By default, ordered list items are styled with regular decimal numbers:

  1. List item
  2. List item
  3. List item

The default ordered list with decimal numbers, comes from the User-Agent Stylesheet (UAS) which is built-in, in all browsers. It’s defined with the CSS property: list-style-type: decimal;

How to add uppercase roman numbers with CSS

To create a list with uppercase roman numbers you need to override the default decimal style numbers, with the CSS property list-style-type:

ol {
  list-style-type: upper-roman;
}

Uppercase roman numbers example:

  1. List item
  2. List item
  3. List item

Has this been helpful to you?

You can support my work by sharing this article with others, or perhaps buy me a cup of coffee 😊

Kofi

Share & Discuss on