HTML Lists

There are three types of list in HTML:

1 - Unordered List:

Unordered list is used to list items which don't has a specific order:

Example:
  • Item 1
  • Item 2
  • Item 3

Syntax:



  <ul>

  <li>Item</li>
  <li>Item</li>
  <li>Item</li>

  </ul>

Unordered list is defined by <ul> </ul> tags.
<li> </li> tags are used to add items in Unordered list.

note: The list items will be marked with bullets by default.

2 - Ordered List:

Ordered list is used to list items in an specific order.

Example:
  1. Item 1
  2. Item 2
  3. Item 3

Syntax:



  <ol>

  <li>Item 1</li>
  <li>Item 2</li>
  <li>Item 3</li>

  < /ol>

Ordered list is defined by <ol> < /ol> tags.
<li> </li> tags are used to add items in Ordered list.

note: The list items will be marked with numbers by default.

3 - Description List:

Description list is used to list items which has a term and description.


Item 1:
- This is an item
Item 2:
- This is an item

Syntax:




  <dl>

    <dt>Item 1</dt>
    <dd>- This is an item</dd>

    <dt>Item 2</dt>
    <dd>- This is an item</dd>

  </dl>
              

Description list is defined by <dl> </dl> tags.
<dt> </dt> tags are used to add Terms in Description list.
<dd> </dd> tags are used to add description in Description list.