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

HTMLWeb DevelopmentFront End Technology

To create ordered list in HTML, use the <ol> tag. Ordered list starts with the <ol> tag. The list item starts with the <li> tag and will be marked as numbers, lowercase letters uppercase letters, roman letters, etc. The default numbers for list items.

For creating an ordered list with numbers, use the <ol> tag attribute type. This attribute will assign the value number i.e. <ol type = “1”> to create ordered list numbered with numbers.

Example

You can try to run the following code to create an ordered list of list items numbered with numbers in HTML −

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <title>World Cup Teams</title>
   </head>
   <body>
      <h1>List of teams for World Cup</h1>
      <ol type = "1">
         <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>
raja
Published on 07-Feb-2018 08:37:31
Advertisements