HTML List

In Html we can provide three types of list

  1. Ordered List
  2. Unordered List
  3. Definition List

Ordered List
This list are used to show information where order is important. for this we use ol tag.
inside <ol>..</ol> we use <li> tag.

Syntax

We can use type attribute to show list number type.

  1. <ol type=”1″ value=”1″> list start with number 1 and its type is numberic
  2. <ol type=”1″ value=”5″> list start with number 5 and its type is numberic
  3. <ol type=”A”>  list start with capital letter A
  4. <ol type=”A” value=”3″>  list start with capital letter C
  5. <ol type=”a”> list will start with small letter a
  6. <ol type=”I”> list will start with capital roman letter
  7. <ol type=”i”> list will start with small roman letter

Example:

Output:

Top 5 ranking of Student

  1. Mohan
  2. Ramesh
  3. Nitesh
  4. Nita
  5. Manish

Unordered List
This list are used to show information where order is not important. for this we use ul tag.
inside <ul>..</ul> we use <li> tag.

You can use type attribute for showing different list market type.
like <li type=”disc”>, <li type=”circle”> or <li type=”square”>

Example:

Output:

Student participation

  • Mohan
  • Ramesh
  • Nitesh
  • Nita
  • Manish

Definition List
To provide terms with definition we use definition list
for using definition list we use <dl>..</dl> tag.
Inside dt tag we use <dt>..</dt> for term to define
For definition(description) of term we use <dd>..</dd>

Example:

Output:

Keyboard
An input device
Monitor
An output device

We can also use nested list means list inside another list of any kind.