List Tags in HTML
HTML List is a collection of items and they may be ordered or unordered. All lists may contain one or more list elements. In other words a list is a record of short pieces of information, such as people's names,fruit's names and etc.
Example:
HTML provides 3 types of lists,those are
- Ordered List ( <ol> ----- </ol> )
- Unordered List ( <ul> ------</ul> )
- Definition List ( <dl> ------</dl> )
1. Ordered List ( <ol> ----- </ol> ) :
- This is used to display the list of items in a order. An order can be the numbers or roman numbers or alphabets.
- This list has one inbuilt tag i.e <li> ----- </li>, it used to specifies the list items.
- In this list the default order is numeric, and we can able to specify the order by using type attribute.
Ex: type="A" (or) type="I" (or) type="a"
Example 1: Default(numeric) order type
- Orange
- Grape
Output:
- Orange
- Grape
Example 2: Alphabet order type
- Orange
- Grape
Output:
- Orange
- Grape
Example 3: Roman Number order type
- Orange
- Grape
Output:
- Orange
- Grape
2. Unordered List ( <ul> ----- </ul> ) :
- This is used to display the list of items by using different symbols.
- This list has one inbuilt tag i.e <li> ----- </li>, it used to specifies the list items.
- In this list the default symbol is dot(.), and we can able to specify the symbol by using type attribute.
Ex: type="square" (or) type="star"
Example 1: Default(.) order type
Output:
Example 2: Star symbol type
Output:
Orange
Grape
Example 3: Square symbol type
Output:
Orange
Grape
3. Definition List ( <dl> ----- </dl> ) :
- The definition list is used to specify list of terms and their definitions.
- It has the following inbuilt tags
<dl> tag specifies the definition list.
<dt> tag specifies the defined term.
<dd> tag specifies the definition for term.
Example :
- HTML
- HTML is Markup language
- XML
- XML is an extended markup language
Output:
- HTML
- HTML is Markup language
- XML
- XML is an extended markup language
Next Topic :Table Tags in HTML