Lists are used to specify the information.The list items starts with <li> tag.There are 3 types of lists:
- Ordered List
- Unordered List
- Description List
Ordered List: The list items are marked with numbers.The ordered list starts with <ol> tag.
<ol>
<li>Apple</li>
<li>Mango</li>
<li>Grapes</li>
</ol>
output:
1.Apple
2.Mango
3.Grapes
Unordered List: The list items are marked with bullets.The Unordered list starts with <ul> tag.
<ul>
<li>Apple</li>
<li>Mango</li>
<li>Grapes</li>
</ul>
output:
Description List: It is also known as definition list .It has 3 tags.
- <dl> tag : start of the list.
- <dt> tag : term.
- <dd> tag :description.
<dl>
<dt>Bangalore</dt>
<dd>-Capital of Karnataka.</dd>
<dt>New Delhi</dt>
<dd>-Capital of India.</dd>
</dl>
output:
Bangalore
-Capital of Karnataka.
New Delhi
-Capital of India.