Ordered Lists
ORDERED LISTS IN HTML
An ordered list defines a list of elements in which the order of items is taken into account.
The list items are enclosed by <OL> and </OL> tags. The ordering here is rendered by a numbering scheme, using Arabic numbers, letters or Roman numerals. An ordered list is also called a numbered list.
An ordered list starts with the
<ol> tag. Each list item starts with the <li> tag.
<!DOCTYPE html>
<html>
<body>
<h2>An ordered HTML list</h2>
<ol>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
</body>
</html>
Output:
An ordered HTML list
- Coffee
- Tea
- Milk
Ordered list of numbers:
<!DOCTYPE html>
<html>
<body>
<h2>Ordered List with Numbers</h2>
<ol type="1">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
</body>
</html>
Output:
Ordered List with Numbers
- Coffee
- Tea
- Milk
Ordered List with Letters:
<!DOCTYPE html>
<html>
<body>
<h2>Ordered List with Letters</h2>
<ol type="A">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
</body>
</html>
Output:
Ordered List with Letters
- Coffee
- Tea
- Milk
Ordered List with Lowercase Letters:
<!DOCTYPE html>
<html>
<body>
<h2>Ordered List with Lowercase Letters</h2>
<ol type="a">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
</body>
</html>
Output:
Ordered List with Lowercase Letters
- Coffee
- Tea
- Milk
Ordered List with Roman Numbers:
<!DOCTYPE html>
<html>
<body>
<h2>Ordered List with Roman Numbers</h2>
<ol type="I">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
</body>
</html>
Output:
Ordered List with Roman Numbers
- Coffee
- Tea
- Milk
Ordered List with Lowercase Roman Numbers:
<!DOCTYPE html>
<html>
<body>
<h2>Ordered List with Lowercase Roman Numbers</h2>
<ol type="i">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
</body>
</html>
Output:
Ordered List with Lowercase Roman Numbers
- Coffee
- Tea
- Milk
Comments
Post a Comment