Different types of list in HTML

Pravin M
2 min readMar 19, 2024
Different types of list in HTML
Different types of list in HTML

Source:- Different types of list in HTML

For more questions and answers visit our website at frontend interview questions

In HTML, there are three main types of lists that can be used to organize and structure content:

  1. Ordered List (`<ol>`): An ordered list is used when the order of the items is important. Each item is represented by an `<li>` (list item) element, and by default, the items are numbered sequentially. The numbering style can be customized using CSS. Here’s an example of an ordered list:

<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ol>

2. Unordered List (`<ul>`):

An unordered list is used when the order of the items is not important. Like the ordered list, each item is represented by an `<li>` element, but instead of numbers, bullet points or other markers are used to denote the items. Here’s an example of an unordered list:


<ul>
<li>Red</li>
<li>Green</li>
<li>Blue</li>
</ul>

3. Definition List (`<dl>`):

A definition list is used to present a list of terms and their corresponding definitions. It consists of `<dt>` (definition term) elements for the terms and `` (definition description) elements for the definitions. Here’s an example of…

--

--

Pravin M
Pravin M

Written by Pravin M

I am a frontend developer with 10+ years of experience Blog :- https://www.frontendinterviewquestions.com

No responses yet