HTML ol Tag type Attribute Tutorial

In this section, we will learn what the type attribute is and how to is it in HTML <ol> element.

What is type Attribute in HTML <ol> Tag?

When using the <ol> element to create a list in an HTML document, by default, the items in the list are marked with numbers.

That means, the first item will appear with the number 1, the second item has the marker 2 and so on.

But this is the default marker and with the help of the `type` attribute, we can change this maker to other signs like (alphabetical characters or roman numbers etc.)

HTML type Attribute in <ol> Tag Syntax:

<ol type = “value”> </ol>

<ol> Tag type Attribute Values

Here’s the list of values that can be used for the `type` attribute.

Name

Description

1

This is the default value. Decimal numbers (1,2,3,4,5)

a

Alphabetically ordered list, lowercase (a, b, c, d)

A

Alphabetically ordered list, uppercase (A, B, C, D)

i

Roman numbers, lowercase (i,ii, iii, iv)

I

Roman numbers, uppercase (I,II, III, IV)

Example: using type attribute in HTML <ol> tag

See the Pen using type attribute in HTML <ol> tag by Omid Dehghan (@odehghan) on CodePen.

Facebook
Twitter
Pinterest
LinkedIn

Top Technologies