webdevlinux - logo Web Dev Linux

HTML Lists

There are 3 different types of HTML lists: unordered lists, ordered lists & description lists. With this chapter, you will understand the differences of each list.

HTML Lists types HTML Lists

Try the example to get a simple idea about HTML lists.

FILE : lists.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>HTML Lists</title>
</head>
<body>
<ul>
	<li>Fedora</li>
	<li>Ubuntu</li>
	<li>Mint</li>
</ul>
<ol>
	<li>January</li>
	<li>February</li>
	<li>March</li>
</ol>
<dl>
	<dt>HTML</dt>
	<dd>HTML is a markup language which is used to make web pages</dd>
	<dt>CSS</dt>
	<dd>CSS is used to add styles on web pages</dd>
</dl>
</body>
</html>

Explanation

Take a look at the explanation of elements used in the example.

<ul></ul>
The ul element represents an unordered list in HTML.
<ol></ol>
The ol element represents an ordered list in HTML.
<li></li>
The li element represents a list item. This is used inside both of unordered list & ordered list.
<dl></dl>
The dl element represents a description list in HTML.
<dt></dt>
The dt element represents description term or description name.
<dd></dd>
The dd element represents the value of description.

In the next chapters, you will see what are the different ways that we use these lists in an HTML document.