HTML <ol> tag

HTML <ol> tag : Definition


• The <ol> tag defines an ordered list. An ordered list can be numerical or alphabetical.

• The <ol> tag generally displayed in bullet points by default that can be modified using CSS.


Html <ol> tag example 1:

<!DOCTYPE html>
<html>
<body>

<ol>
    <li>I'm first list</li>
    <li>I'm second list</li>
    <li>I'm third list</li>
    <li>I'm four list</li>
    <li>I'm fifth list</li>
</ol>



</body>
</html>

Output:

The ordered list <ol> is generally displayed in an ascending number or in a letter.

  1. This is first list
  2. This is second list
  3. This is third list
  4. This is fourth list
  5. This is fifth list


Html <ol> tag example 2: type="I"

<!DOCTYPE html>
<html>
<body>

<ol type="I">
    <li>I'm first list</li>
    <li>I'm second list</li>
    <li>I'm third list</li>
    <li>I'm four list</li>
    <li>I'm fifth list</li>
</ol>



</body>
</html>

Output :

 
  1. I'm first list
  2. I'm second list
  3. I'm third list
  4. I'm four list
  5. I'm fifth list


Html <ol> tag example 3: start="10"

<!DOCTYPE html>
<html>
<body>



<ol start="10">
    <li>I'm first list</li>
    <li>I'm second list</li>
    <li>I'm third list</li>
    <li>I'm four list</li>
    <li>I'm fifth list</li>
</ol>

</body>
</html>

Output :

 
  1. I'm first list
  2. I'm second list
  3. I'm third list
  4. I'm four list
  5. I'm fifth list


Html <ol> tag example 4: reversed="5"

<!DOCTYPE html>
<html>
<body>



<ol reversed="5">
    <li>I'm first list</li>
    <li>I'm second list</li>
    <li>I'm third list</li>
    <li>I'm four list</li>
    <li>I'm fifth list</li>
</ol>

</body>
</html>

Output :

 
  1. I'm first list
  2. I'm second list
  3. I'm third list
  4. I'm four list
  5. I'm fifth list