Instead of bullets user can also use the numbers by using the
<ol> tag which give the numbering starting from 1 to the list elements. The code below demonstrates giving numbering to the list by using the
<ol> tag.
[html]
<html>
<head>
<title>HTML ordered List</title>
</head>
<body>
<ol>
<li>Item1</li>
<li>Item2</li>
<li>Item3</li>
<li>Item4</li>
</ol>
</body>
</html>
[/html]
Result
By running the above code in a preferred browser user can get the following output as shown in below image.
Start with alphabet 'A'
Instead of the numbers user can also get the alphabets by changing the
<ol type=”A”>. The code below demonstrates getting the ordered list with alphabets.
[html]
<!DOCTYPE html>
<html>
<head>Start with"A"t</title>
</head>
<body>
<ol type="A">
<li>Item1</li>
<li>Item2</li>
<li>Item3</li>
<li>Item4</li>
</ol>
</body>
</html>
[/html]
Result
By running the above code in a preferred browser user can get the following output as shown in below image.
Start with alphabet 'a'
Instead of the capital letters user can also get the small letters by changing the
<ol type=”a”>. The code below demonstrates getting the ordered list with alphabets.
[html]
<html>
<head>
<title>Start with"a"</title>
</head>
<body>
<ol type="a">
<li>Item1</li>
<li>Item2</li>
<li>Item3</li>
<li>Item4</li>
</ol>
</body>
</html>
[/html]
Result
By running the above code in a preferred browser user can get the following output as shown in below image.
Start with Roman Numbers
Instead of the normal numbers and alphabets user can also get the roman numbers by changing the
<ol type=” I”>. The code below demonstrates getting the ordered list with Roman Numbers.
[html]
<html>
<head>
<title>Start With Roman Number</title>
</head>
<body>
<ol type="I">
<li>Item1</li>
<li>Item2</li>
<li>Item3</li>
<li>Item4</li>
</ol>
</body>
</html>
[/html]
Result
By running the above code in a preferred browser user can get the following output as shown in below image.
Start with number '1'
Instead of roman numbers user can also give the numbers by using
<ol> tag which give the numbering starting from 1 to the list elements. The code below demonstrates giving numbering to the list.
[html]
<html>
<head>
<title>Start with Number</title>
</head>
<body>
<ol>
<li>Item1</li>
<li>Item2</li>
<li>Item3</li>
<li>Item4</li>
</ol>
</body>
</html>
[/html]
Result
By running the above code in a preferred browser user can get the following output as shown in below image.
The code below demonstrates the complete example of the Ordered list.
[html]
<html>
<h4>Default "ol"</h4>
<ol>
<li>Item1</li>
<li>Item2</li>
<li>Item3</li>
<li>Item4</li>
</ol>
<h4>Start with alphabet 'A'</h4>
<ol type="A">
<li>Item1</li>
<li>Item2</li>
<li>Item3</li>
<li>Item4</li>
</ol>
<h4>Start with alphabet 'a'</h4>
<ol type="a">
<li>Item1</li>
<li>Item2</li>
<li>Item3</li>
<li>Item4</li>
</ol>
<h4>Start with Roman Numbers</h4>
<ol type="I">
<li>Item1</li>
<li>Item2</li>
<li>Item3</li>
<li>Item4</li>
</ol>
<h4>Start with number '1'</h4>
<ol start="1">
<li>Item1</li>
<li>Item2</li>
<li>Item3</li>
<li>Item4</li>
</ol>
</html>
[/html]
Result
By running the above code in a preferred browser user can get the following output as shown in below image.