what are the types of list in the HTML?
lists can be used to show different pieces of information that are related to each other. Listing the features of a particular product can be a simple example of a list. So, lists are important for showing any information on websites, which is why they are available in HTML.
There are three types of lists in HTML
- Ordered lists
- Unordered lists (the one being used in this list too)
- Definition lists
There are different tags in HTML to represent all different types of lists. Here’s the table to show all the tags as a reference.
Tag | Description |
---|---|
< ul> | Unordered list |
< ol> | Ordered list |
< li> | List item |
< dl> | Description list |
< dt> | Defines a term in the description list |
< dd> | Describes a term in the description list |
HTML Lists
HTML Lists are used to specify lists of information. All lists may contain one or more list elements. There are three different types of HTML lists:
- Ordered List or Numbered List (ol)
- Unordered List or Bulleted List (ul)
- Description List or Definition List (dl)
A. HTML Ordered List or Numbered List
In the ordered HTML lists, all the list items are marked with numbers by default. It is known as numbered list also. The ordered list starts with < ol > tag and the list items start with < li > tag.
Example
< ol >
< li >Aries< /li >
< li >Bingo< /li >
< li >Leo< /li >
< li >Oracle< /li >
< /ol >
Output Like this :
- Aries
- Bingo
- Leo
- Oracle
B. HTML Unordered List or Bulleted List
In HTML Unordered list, all the list items are marked with bullets. It is also known as bulleted list also. The Unordered list starts with < ul > tag and list items start with the < li > tag.
Example
< ul >
< li >Aries< /li >
< li >Bingo< /li >
< li >Leo< /li >
< li >Oracle< /li >
< /ul >
Output Like this :
- Aries
- Bingo
- Leo
- Oracle
C. HTML Description List or Definition List
HTML Description list is also a list style which is supported by HTML and XHTML. It is also known as definition list where entries are listed like a dictionary or encyclopedia.
The definition list is very appropriate when you want to present glossary, list of terms or other name-value list.
The HTML definition list contains following three tags:
- < dl > tag defines the start of the list.
- < dt > tag defines a term.
- < dd > tag defines the term definition (description).
Example
< dl >
< dt >Aries< /dt >
< dd >-One of the 12 horoscope sign.< /dd >
< dt >Bingo< /dt >
< dd >-One of my evening snacks< /dd >
< dt >Leo< /dt >
< dd >-It is also an one of the 12 horoscope sign.< /dd >
< dt >Oracle< /dt >
< dd >-It is a multinational technology corporation.< /dd >
< /dl >
Output Like this :
Aries
-One of the 12 horoscope sign.
Bingo
-One of my evening snacks
Leo
-It is also an one of the 12 horoscope sign.
Oracle
-It is a multinational technology corporation.