HTML Description List
HTML element <dl>
is used to define a description list with element <dt>
defining each term and element <dd>
defining its description as shown below.
- Element
<dl>
to define a description list - Element
<dt>
to define each term of a list - Element
<dd>
to define a description of each term of a list
By default, each item on the list should be defined with <dl>
element followed by <dd>
element.
<dl>
<dt>Term 1</dt>
<dd>Description of term 1</dd>
<dt>Term 2</dt>
<dd>Description of term 2</dd>
<dt>Term 3</dt>
<dd>Description of term 3</dd>
</dl>
Example
We can check the outcome of the below HTML document to see how it looks.
<!doctype html>
<html lang="en">
<head>
</head>
<body>
<h1>HTML Description List</h1>
<dl>
<dt>Term 1</dt>
<dd>Description of term 1</dd>
<dt>Term 2</dt>
<dd>Description of term 2</dd>
<dt>Term 3</dt>
<dd>Description of term 3</dd>
</dl>
</body>
</html>
Other List Types
Take a look at the article on HTML Lists to know more about other types of HTML lists.
Overall
We can use a description list when we want to group a list of terms and their descriptions together.