HTML - Lists




HTML Lists

To arrange the text in order sometime, we need to list them, so html list helps to do that.

Following are the three different types of lists −

  • Ordered List or Numbered List (ol)

  • Unordered List or Bulleted List (ul)

  • Description List or Definition List (dl)

For example −

HTML Ordered Lists

An ordered list starts with the <ol> tag. Each list item starts with the <li> tag.

List items are marked with numbers.

Example

<ol>
<li>Apple</li>
<li>Banana</li>
</ol>

Result

  1. Apple
  2. Banana

HTML Unordered Lists

An unordered list starts with the <ul> tag. Each list item starts with the <li> tag.

Example

<ul>
<li>Blackberry</li>
<li>Grapes</li>
</ul>

Result

  • Blackberry
  • Grapes

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.

Example

<dl>
<dt>Apricot</dt>
<dd>An Apple</dd>
<dt>Gooseberry</dt>
<dd>Animal</dd>
</dl>

Result

Apricot
An Apple
Gooseberry
Animal