HTML Lists are used to specify lists of information. All lists may contain one or more list elements.
There are three different types of HTML lists as below:
- Ordered List or Numbered List (ol)
- Unordered List or Bulleted List (ul)
- Description List or Definition List (dl)
HTML Ordered List or Numbered List
We can group a set of related items in lists using Ordered List as below.
Syntax for Ordered List or Numbered List (ol) :
<ol>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
</ol>
The ordered list starts with <ol> tag and the list items start with <li> tag.
HTML Unordered List or Bulleted List
We can group a set of related items in lists using Unordered List as below.
Syntax for Unordered List or Bulleted List (ul) :
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
</ul>
The Unordered list starts with <ul> tag and the list items start with <li> tag.
HTML Description List or Definition List
We can group a set of related items in lists using Description List as below.
Syntax for Description List or Definition List(dl) :
<dl>
<dt>Item 1</dt>
<dd>- Item 1 description</dd>
<dt>Item 2</dt>
<dd>- Item 2 description</dd>
</dl>
The HTML definition list contains below three tags
<dl> tag defines the start of the list.
<dt> tag defines a term.
<dd> tag defines the term definition (description).
Let's see below example to understand HTML Lists in details.
Comments