HTML <ol> type attribute specifies the numbering style for ordered lists. It can be set to "1" for numerical, "A" for uppercase alphabetical, "a" for lowercase alphabetical, "I" for uppercase Roman numerals, or "i" for lowercase Roman numerals.
Syntax:
<ol type="1 | a | A | i | I">
Attribute Values:
Value | Description |
---|---|
1 | This is the default value. It defines the list items in decimal number.(1, 2, 3, 4 .). |
a | It defines the list items in alphabetically ordered lowercase letters .(a, b, c, d ...) |
A | It defines the list items in alphabetically ordered uppercase letters.(A, B, C, D ..) |
i | It defines the list items in lowercase roman number order.(i, ii, iii, iv, v, vi ...) |
I | It defines the list items in uppercase roman number order.(I, II, III, IV, V, VI ..) |
HTML <ol> type attribute Examples
Example 1: In this example we defines an ordered list (<ol>) with the type="1" attribute, specifying numbering style as decimal. It lists HTML, CSS, and JS. The page also displays a title and a heading.
<!DOCTYPE html>
<html>
<head>
<title>HTML ol type attribute</title>
</head>
<body>
<p>Type attribute</p>
<p>start attribute</p>
<ol type="1">
<li>HTML</li>
<li>CSS</li>
<li>JS</li>
</ol>
</body>
</html>