Order list

In HTML, you can create an ordered list (numbered list) using the <ol> element. Inside the <ol>, each list item is defined using the <li> (list item) element. Here's an example:

Basic Structure
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ol>

Try it yourself


Common list-style-type Values:

Attribute Value
Description
type="A"
Uppercase letters
type="a"
Lowercase letters
type="I"
Roman numerals
type="i"
Lowercase Roman numerals

Example
<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>

Try it yourself


Nested Lists:

Ordered lists can be nested inside each other to create sub-lists.

Example
<ol>
<li>Fruit
<ol>
<li>Apples</li>
<li>Bananas</li>
</ol>
</li>
<li>Vegetables
<ol>
<li>Carrots</li>
<li>Broccoli</li>
</ol>
</li>
</ol>

Try it yourself


Whereisstuff is simple learing platform for beginer to advance level to improve there skills in technologies.we will provide all material free of cost.you can write a code in runkit workspace and we provide some extrac features also, you agree to have read and accepted our terms of use, cookie and privacy policy.
© Copyright 2024 www.whereisstuff.com. All rights reserved. Developed by whereisstuff Tech.