Loading lesson path
Concept visual
Start at both ends
<ol> tag defines an ordered list. An ordered list can be numerical or alphabetical.
<ol> tag. Each list item starts with the <li> tag. The list items will be marked with numbers by default:
<ol>
Formula
< li > Coffee </li >
< li > Tea </li >
< li > Milk </li ></ol>
Formula
Ordered HTML List - The Type Attribute<ol> tag, defines the type of the list item marker:
Description type="1" The list items will be numbered with numbers (default) type="A" The list items will be numbered with uppercase letters type="a" The list items will be numbered with lowercase letters type="I" The list items will be numbered with uppercase roman numbers type="i" The list items will be numbered with lowercase roman numbers
<ol type="1">
Formula
< li > Coffee </li >
< li > Tea </li >
< li > Milk </li ></ol>
<ol type="A">
Formula
< li > Coffee </li >
< li > Tea </li >
< li > Milk </li ></ol>
<ol type="a">
Formula
< li > Coffee </li >
< li > Tea </li >
< li > Milk </li ></ol>
Formula
Roman Numbers - Uppercase<ol type="I">
Formula
< li > Coffee </li >
< li > Tea </li >
< li > Milk </li ></ol>
Formula
Roman Numbers - Lowercase<ol type="i">
Formula
< li > Coffee </li >
< li > Tea </li >
< li > Milk </li ></ol>
By default, an ordered list will start counting from 1. If you want to start counting from a specified number, you can use the start attribute:
<ol start="50">
Formula
< li > Coffee </li >
< li > Tea </li >
< li > Milk </li ></ol>
Lists can be nested (list inside list):
<ol>
Formula
< li > Coffee </li >
< li > Tea<ol>
Formula
< li > Black tea </li >
< li > Green tea </li ></ol> </li>
Formula
< li > Milk </li ></ol>
A list item ( <li> ) can contain a new list, and other HTML elements, like images and links, etc.
<ol> element to define an ordered list
type attribute to define the numbering type
<li> element to define a list item