Commencing with the <ol> tag, an ordered list is initiated. Each item within the list is identified with the <li> tag.
By default, the list items are numbered.
Example
<ol> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ol> |
The type attribute of the <ol> tag determines the style of the list item marker.
Type |
Description |
type=”1″ |
The default numberinf for list items will be numerical. |
type=”A” |
The list items will be numbered using uppercase letters |
type=”a” |
The list items will be numbered using lowercase letters |
type=”I” |
The list items will be numbered using uppercase roman numbers |
type=”i” |
The list items will be numbered using lowercase roman numbers |
<ol type=”1″> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ol> |
<ol type=”A”> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ol> |
<ol type=”a”> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ol> |
<ol type=”I”> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ol> |
<ol type=”i”> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ol> |
By default, an ordered list begins counting from 1. If you wish to start counting from a specific number, you can utilize the start attribute.
Example
<ol start=”50″> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ol> |
Lists have the capability to be nested, meaning one list can be contained within another.
Example
<ol> <li>Coffee</li> <li>Tea <ol> <li>Black tea</li> <li>Green tea</li> </ol> </li> <li>Milk</li> </ol> |
Certainly! An item in a list (<li>) can encompass a new list as well as other HTML elements such as images, links, and more. |