<ol>



HTML <ol> tag

The <ol> tag specifies an ordered list of items.

The <ol> element represents an ordered list of items, it represents list of items by characters or numbers.

Ordered list declared using the <ol> tag and all of its list items are be written inside the <li> tag.

 


Syntax : 

<ol>
	<li>Item 1</li>
	<li>Item 2</li>
	||||||||
	||||||||
	||||||||
	<li>Item N</li>
</ol>

Example :

<ol>
  <li>Pink</li>
  <li>Green</li>
  <li>Yellow</li>
  <li>Brown</li>
</ol>

Ordered List Style Type Attribute


List Style Type Description Syntax
Numbers  Starts a list using numbers (default)  <ol type="1">
Uppercase letters   Starts a list using uppercase letters   <ol type="A">
Uppercase roman numbers Starts a list using uppercase roman numbers   <ol type="I"> 
Lowercase roman numbers  Starts a list using lowercase roman numbers  <ol type="i"> 

Example :

<!DOCTYPE html>
<html>
  <head>
    <title>Unordered List</title>
  </head>
  <body>
    <h2>Ordered List of Fruits with Numbers </h2>
    <ol type="1">
      <li>Apple</li>
      <li>Banana</li>
      <li>Mango</li>
    </ol>

    <h2>Ordered List of Colors with Uppercase letters</h2>
    <ol type="A">
      <li>Red</li>
      <li>Green</li>
      <li>Blue</li>
    </ol>

    <h2>Ordered List of Fruits with Lowercase letters</h2>
    <ol type="a">
      <li>Apple</li>
      <li>Banana</li>
      <li>Mango</li>
    </ol>

    <h2>Ordered List of Colors with Lowercase roman numbers</h2>
    <ol type="i">
      <li>Black</li>
      <li>Green</li>
      <li>Blue</li>
    </ol>

    <h2>Ordered List of Colors with Uppercase roman numbers</h2>
    <ol type="I">
      <li>Black</li>
      <li>Green</li>
      <li>Blue</li>
    </ol>
  </body>
</html>

Output :