HTML Ordered List

HTML Ordered List or Numbered List displays elements in numbered format. For an ordered list, the HTML ol tag is used. We can use an ordered list to represent objects in numerical order, alphabetical order, or any other structure that emphasizes order. There are various sorts of numbered lists:

  • Numeric Number (1, 2, 3)
  • Capital Roman Number (I II III)
  • Small Romal Number (i ii iii)
  • Capital Alphabet (A B C)
  • Small Alphabet (a b c)

To represent different ordered lists, there are 5 types of attributes in <ol> tag.

<ol> Tag Attributes

HTML <ol> tag specified Order list display list of item and its attribute help to change the type of order list.

AttributesValueDescription
type1
a
A
i
I
Arabic number,
Lowercase alphabet,
Uppercase alphabet,
Lowercase roman numeral,
Uppercase roman numeral,
Default value is “1”.
start“1”define start sequence number of the list.

<li> Tag Attributes

HTML <li> tag specified list items and its attribute help to change the type of order list.

AttributesValueDescription
type1
a
A
i
I
Arabic Number,
Lowercase alphabet,
Uppercase alphabet,
Lowercase roman numeral,
Uppercase roman numeral,
Default value is “1”.
start“1”define start sequence number of the list.
Example

<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8″>
<title> HTML Ordered List </title>
</head>
<body>
<h2>HTML Ordered list</h2>
<ol>
<li>Codelivly</li>
<li>Rocky</li>
<li>HTML</li>
</ol>
</body>
</html>

Output

  1. Codelivly
  2. Rocky
  3. HTML

Leave a Comment

Your email address will not be published.