<ol> for ordered list

The ol element creates an ordered list. The items in the list are denoted using the li element. The ol element has attributes: start, reversed, type.

 
<!DOCTYPE HTML> 
<html> 
<head> 
<title>Example</title> 
</head> 
<body> 
    I like: 
    <ol> 
        <li>HTML</li> 
        <li>CSS</li> 
        <li>Javascript</li> 
        <li>SQL</li> 
        <li>Java</li> 
        <li>C#</li> 
    </ol> 

</body> 
</html>
  
Click to view this demo.

The start attribute defines the ordinal value of the first item. By default, the first item is assigned the ordinal value of 1. The type attribute indicates which marker should be displayed next to each item.

The following tabls lists the supprted values for the type Attribute of the ol Element:

ValueDescriptionExample
1Decimal numbers (default)1., 2., 3., 4.
aLowercase Latin charactersa., b., c., d.
AUppercase Latin charactersA., B., C., D.
iLowercase Roman charactersi., ii., iii., iv.
IUppercase Roman charactersI., II., III., IV.

The following code shows the Lowercase Latin characters

 
<!DOCTYPE HTML> 
<html> 
<head> 
<title>Example</title> 
</head> 
<body> 
    I like: 
    <ol type='a'> 
        <li>HTML</li> 
        <li>CSS</li> 
        <li>Javascript</li> 
        <li>SQL</li> 
        <li>Java</li> 
        <li>C#</li> 
    </ol> 

</body> 
</html>
  
Click to view this demo.

The following code shows the uppercase roman characters

 
<!DOCTYPE HTML> 
<html> 
<head> 
<title>Example</title> 
</head> 
<body> 
    I like: 
    <ol type='I'> 
        <li>HTML</li> 
        <li>CSS</li> 
        <li>Javascript</li> 
        <li>SQL</li> 
        <li>Java</li> 
        <li>C#</li> 
    </ol> 

</body> 
</html>
  
Click to view this demo.
Home 
  HTML CSS Book 
    HTML  

Related: