webdevlinux - logo Web Dev Linux

HTML Ordered Lists

HTML ordered lists are referenced by numbers or letters. With this chapter, you will learn different types of ordered lists and how we use them in an HTML document.

HTML Ordered lists Ordered List type A

Try the example below

FILE : ordered-lists.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>HTML Ordered Lists</title>
</head>
<body>
<ol type="A">
	<li>First</li>
	<li>Second</li>
	<li>Third</li>
</ol>
<ol reversed type="i">
	<li>Three</li>
	<li>Two</li>
	<li>One</li>
</ol>
<ol start="6">
	<li>Six</li>
	<li>Seven</li>
	<li>Eight</li>
	<li value="2">Two</li>
	<li>Three</li>
</ol>
</body>
</html>

Explanation

Take a look at the explanation of attributes used in the example.

type
In an ordered list, the type attribute represents the reference type of the list. One of these values are permitted at once for the type attribute : A, a, 1, i, I
type="A"
The attribute value A represents a list of Uppercase letters. (A, B, C..)
type="a"
The attribute value a represents a list of Lowercase letters. (a, b, c..)
type="1"
The attribute value 1 represents a list of Numbers. (1, 2, 3..). This is the default value of the ordered list. In other words, If the type attribute is not declared then it represents as a list of numbers.
type="I"
The attribute value I represents a list of Uppercase roman numbers. (I, II, III..)
type="i"
The attribute value i represents a list of Lowercase roman numbers. (i, ii, iii..)
start="50"
You can use the start attribute only in a list of numbers (type="1"). Attribute value tells the starting number of the list.
reverse
The reverse attribute is used to get a descending list. It can be used in any type of ordered lists.
value="2"
The value attribute is used to change the numbering order of a numeric list.