What are different tags to list items in HTML?
There are 3 HTML Listing tags to display a list of items.
Ordered List:
HTML ordered list starts with the <ol> tag and items are listed in <li> tag. This is used when we need to provide list of items marked with numbers or similar format.
Example
<ol>
<li>Item 1</li>
<li>Item 2</li>
</ol>
Unordered List:
HTML unordered list starts with the <ul> tag and items are listed in the same <li> tag. This is used when we need to provide list of items marked with bullets or similar symbols.
Example
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
Description List:
An HTML description list provides a list of terms, with a description of each term.
<dl>
<dt>HTML</dt>
<dd>HTML stands for Hypertext Markup Language</dd>
<dt>Computer</dt>
<dd>Computer is a machine or device for storing and processing data</dd>
</dl>
Most of the time, we only use Ordered and Unordered lists in HTML. Sometimes, we refer to another <datalist> tag but it has different use to list of pre-defined options for an <input> element. This is introduced in HTML5.
Learn more about the similar topics:
| Tutorials |
|---|
| No Content Found. |
| Exercises & Assignments |
|---|
| No Content Found. |
| Interview Questions & Answers |
|---|
| No Content Found. |