Dofactory.com
Dofactory.com

HTML <dl> Tag

The <dl> tag creates a description list, somewhat like a dictionary.

A description list is a container for one or more <dt> (data term) and <dd> (data description) pairs.

Example

#

A <dl> element with three museums and their locations.

Kunstmuseum
Basel, Switzerland
National Gallery of Art
Washington DC, USA
Musée d'Orsay
Paris, France
<dl>
  <dt>Kunstmuseum</dt>
  <dd>Basel, Switzerland</dd> 
  <dt>National Gallery of Art</dt>
  <dd>Washington DC, USA</dd>
  <dt>Musée d'Orsay</dt>
  <dd>Paris, France</dd>
</dl>
dl = description list
dt = data term
dd = data description

Using <dl>

The <dl> tag is used to define a description list, similar to a dictionary with item/description pairs.

The items below are the tags used to create an HTML description list.

  • <dl> - defines a description list
  • <dt> - defines a data term or name
  • <dl> - defines the data definition, description, or value

Attributes for <dl>

The <dl> element has no attributes, but it does accept global attributes. The following are commonly used.

Attribute Value Description
id   value Provides the dl element with a unique identifier.
class   classnames Assigns one or more classnames to the dl element.
style   CSS-values Assigns CSS style values to the dl element.

For additional global attributes see our global attributes list.


List Tags

The <dl> tag is part of a group of tags that are used to create lists (i.e. lists of items) on web pages. This group is referred to as the List tag group. Together, they allow you to create comprehensive HTML lists.

Below are the list tags.

Element Description
<ul> Creates an unordered, bulleted list
<ol> Creates a numerically or alphabetically ordered list
<li> Defines a list item. Used in <ol> and <ul> elements
<dl> Defines a description list
<dt> Adds a term or name to a <dl> element
<dd> Adds a description of a term or name to a <dl> element

Browser support

Here is when <dl> support started for each browser:

Chrome
1.0 Sep 2008
Firefox
1.0 Sep 2002
IE/Edge
1.0 Aug 1995
Opera
1.0 Jan 2006
Safari
1.0 Jan 2003

You may also like


Last updated on Sep 30, 2023




Guides