How to create an ordered list with list items numbered with lowercase letters in HTML?


An ordered list is a numbered list of items. It gives you the ability to control the sequence number in the context. Allow us to group a set of related items in lists.

HTML support ordered list, unordered list and we have to use the <ol> tag, to create ordered list in HTML. The <ol> tag defines the ordered list. We use <li> tag to start list of items. The list of items can be marked as numbers, lowercase letters uppercase letters, roman letters, etc.

The default order is numbers for list items in the context.

  • The <li> tag should be placed inside the <ol> tag to create the list of items.

  • We use type attribute of the <ol> tag, for creating an ordered list with numbers.

  • We can also use <ol type = “a”> attribute to create ordered list numbered with numbers.

Syntax

Following is the syntax to create an ordered list items numbered with lowercase letters in HTML.

<ol type="a">
   <li>Item in list…</li>
   <li>Item in list…</li>
   <li>Item in list…</li>
</ol>

Example 1

Given below is an example to create an ordered list items numbered with lowercase letters in HTML.

<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <ol type="a"> <li>Abdul</li> <li>Jason</li> <li>Yadav</li> <li>Lokesh</li> </ol> </body> </html>

Following is the output for the above example program.

Example 2

Another example to create an ordered list with list items numbered with lowercase letters in HTML −

<!DOCTYPE html> <html> <head> <title>World Cup Teams</title> </head> <body> <h1>List of teams for World Cup</h1> <ol type = "a"> <li>India</li> <li>Australia</li> <li>South Africa</li> <li>New Zealand</li> <li>Pakistan</li> <li>Srilanka</li> <li>West Indies</li> <li>Bangladesh</li> </ol> </body> </html>

The output achieved after executing the above HTML code is −

Updated on: 23-Nov-2023

920 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements