Friday 2 December 2022

HTML- Ordered List Or Number List (ol)


 HTML- Ordered List Or Number List (ol)

========================================================================

===============================================================

Ordered List Or Number List (ol)
In HTML, all the list items in an ordered list are marked with numbers by default instead of bullets. An HTML ordered list starts with the <ol> tag and ends with the </ol> tag. The list items start with the <li> tag and end with </li> tag.
 Syntax:
<ol>List of Items</ol>
============================================================
Example of HTML Ordered List
  
<!DOCTYPE html>
<html>
<head>
<title> Ordered List Or Number List (ol)</title>
</head>
<body>
<h1> Ordered List Or Number List (ol)</h1>
<ol>
<li> Std-I</li>
<li> Std-II</li>
<li> Std-III</li>
<li> Std-IV</li>
<li> Std-V</li>
</ol>
</body>
</html> 
Output:

 



 ================================================================

 

========================================================================

Different Types of Ordered Lists in HTML

Instead of numbers, you can mark your list items with the alphabet: A, B, C or a,b,c, or roman numerals: i, ii, iii, etc. You can do this by using the type attribute in the <ol> tag. Let’s explore how to order lists with alphabets and roman numbers.
To mark the list items with letters A, B, C, etc., you will have to specify A as the type attribute’s value in the <ol> tag.
<ol type="A">


Here is an example to show the use of Upper case letters to list the items.
<!DOCTYPE html>
<html>
<head>
<title> Different Types of Ordered Lists in HTML</title>
</head>
<body>
<h1> Different Types of Ordered Lists in HTML specify A</h1>
<br>
<h1> Primary School I-V</h1>
<ol type="A">
<li> Std-I</li>
<li> Std-II</li>
<li> Std-III</li>
<li> Std-IV</li>
<li> Std-V</li>
</ol>
<br>
 
<h2> Secondary School VI-VIII</h2>
<p> Here is an example to show the use of Roman Number letters to list the items.</p>
<ol type="I">
<li> Std-VI</li>
<li> Std-VII</li>
<li> Std-VIII</li>
</ol>
<br>
 
 
<h2> Higher Secondary School IX-X</h2>
<p>Here is an example to show the use of Lower case letters to list the items.</p>
<ol type="a">
<li> Std-IX</li>
<li> Std-X</li>
</ol>
</body>
</html>

Output:- 


========================================================================

 

No comments:

Post a Comment