A list in HTML is a collection of items that are displayed in a list format with bullet points. Lists are used to represent real-life data. There are three list types in HTML, each with a specific purpose and tag.
- Ordered List 2. Unordered List 3. Description List
An Ordered list, also known as a step-by-step list, has a specific order or sequence and is marked with numbers. It begins with the <ol> tag and closes with a </ol> tag, while the list items begin with the <li> tag and end with </li> tag. An Ordered list is ideal for presenting a recipe, a to-do list, or any process.
<p>How to make tea?</p> <ol> <li>Take a cup of water</li> <li>Boil it up to 5 minutes</li> <li>Now add 1/2 spoon tea-leaf</li> <li>Boil it for 2 minutes</li> <li>Add 1 full spoonful of sugar</li> <li>Wait for 3 minutes and Now you can serve it.</li> </ol>
How to make tea?
- Take a cup of water
- Boil it up to 5 minutes
- Now add 1/2 spoon tea-leaf
- Boil it for 2 minutes
- Add 1 full spoonful of sugar
- Wait for 3 minutes and Now you can serve it.
We can change the list style type by using the CSS property. - Numbers, Alphabets(small & caps), Roman(small & caps).
An unordered list, also known as a bulleted list, has no specific order or sequence and is marked with bullets. It begins with the <ul> tag and closes with a </ul> tag, while the list items begin with the <li> tag and end with </li> tag. An unordered list is ideal for presenting a glossary, list of terms, or other name/value list.
<p>List of fruits</p> <ul> <li>Mango</li> <li>Apple/li> <li>Banana</li> <li>Orange</li> </ul>
List of fruits
- Mango
- Apple
- Banana
- Orange
We can change the list style type by using CSS property. - Bullet, Circle, Disk, Square.
HTML also supports description lists. A description list is a list of terms, with a description of each term. The <dl> tag defines the description list, the <dt> tag defines the term (name), and the <dd> tag describes each term
<dl>
<dt>How to make : Tea</dt>
<dd>Take a small container that is used to make tea.</dd>
<dd>
Consume a limited amount of water according to how many people want to
take the tea. suppose 3 people
</dd>
<dd>For 3 people we need to use 1 litre of water.</dd>
<dd>use 2 full spoon tea leaf.</dd>
<ldd>use 2+1/2 spoon sugar.</dd>
<dd>Boil it at least 12 minutes.</dd>
<dt>How to make : maggie</dt>
<dd>Lorem ipsum dolor sit amet consectetur adipisicing.</dd>
<dd>Lorem ipsum dolor sit amet.</dd>
<dd>Lorem ipsum dolor sit amet consectetur.</dd>
<dd>Lorem ipsum dolor sit amet consectetur adipisicing.</dd>
</dl>
This is a rarely used list type and is used for informative lists.
Note : For the list Border style We need to check out CSS.
