Lists in HTML
What is List?
List is a group of items related to each other.
Typed of list in html
- Unordered list
- Ordered list
- Defination list
Unordered V/S Ordered List
Unordered list
- Unordered list is a group of related items arrange in no order.
- Order list is created by using <ul> </ul> tag.
- <li> </li> tag is used to create list items in the list.
Creating Unordered List
Sample output of unordered list |
<ul>
<li>Tea</li>
<li>Coffee</li>
<li>Cold Drink</li>
</ul>
<li>Tea</li>
<li>Coffee</li>
<li>Cold Drink</li>
</ul>
Types of Unordered List
Types of unordered list |
Ordered List
<ol>
- Ordered list is a group of elements a particular order.
- <ol> </ol> tag is used to create ordered list.
Sample output of the ordered list |
<li>Tea</li>
<li>Coffee</li>
<li>Cold Drink</li>
</ol>
Types of ordered list
Types of ordered list |
Examples of ordered list
Ordered List Examples |
Ordered list example with roman numbering |
Definition List
Definition list a group of items with key (terms) and value (definition) pair.
- <dl> tag is used to create definition list.
- <dt> tag creates definition term.
- <dd> tag creates definition data
Creating definition list
<dl><lh>Definition Header</lh>
<dt>Term-1</dt>
<dd>This is the definition of the first term</dd>
<dt>Definition Term-2</dt>
<dd>This is the definition of the second term</dd>
</dl>
Watch Video, Lists in HTML
Comments