Lists

HTML lists are used to display on web pages to group a set of related items in lists. The following are the various types of list in HTML:

  1. Unordered List
  2. Ordered List
  3. Defintion List

1. Unordered List: These list of items will be displayed using bullets.

Attribute of ul:
1. type = "disc | circle | square"
<h2>List of Cars:</h2>
<ul type="square">
<li>Maruthi</li>
<li>Mahendra</li>
<li>Audi</li>
<li>BMW</li>
</ul>

List of Cars:

  • Maruthi
  • Mahendra
  • Audi
  • BMW

2. Ordered List: These list of items will be displayed using numbers.

Attribute of ul:
1. type = "1 | A | a | I | i"
2. start = "value"
<h2>List of Cars:</h2>
<ol type="A">
<li>Maruthi</li>
<li>Mahendra</li>
<li>Audi</li>
<li>BMW</li>
</ul>

List of Cars:

  1. Maruthi
  2. Mahendra
  3. Audi
  4. BMW

3. Definition List: The <dl> tag defines the description list, the <dt> tag defines the term (name), and the <dd> tag describes each term.

<dl>
<dt>Array:</dt>
<dd>An Array is a collection of similar type of elements under single name.</dd>
</dl>

Array:
An Array is a collection of similar type of elements under single name.