Code has been added to clipboard!

HTML dl Tag

Reading time 2 min
Published Mar 19, 2019
Updated Oct 1, 2019

HTML dl: Main Tips

  • The <dl> element represented an HTML definition list in HTML4.
  • In HTML5, it was repurposed and renamed as the description list. This also made it more of a semantic element.
  • Such lists work well for glossaries, metadata, FAQs, and similar type of lists.
  • The HTML dl element supports all global attributes.

What is dl?

What does dl mean? Since HTML5, it stands for a description list. Such a list contains name-value pairs: terms and their definitions, questions and answers, etc. In these pairs, the <dt> elements represent the names, and the <dd> elements stand for the values.

Example
<dl>
  <dt>Car</dt>
  <dd>A vehicle used for boring transportation.</dd>
  <dt>Hot air balloon</dt>
  <dd>A vehicle used for fun transportation.</dd>
</dl>

Tip: you can wrap your HTML dl elements in <div> tags for styling purposes or to apply global attributes.

Udacity
Pros
  • Simplistic design (no unnecessary information)
  • High-quality courses (even the free ones)
  • Variety of features
Main Features
  • Nanodegree programs
  • Suitable for enterprises
  • Paid certificates of completion
Coursera
Pros
  • Professional service
  • Flexible timetables
  • A variety of features to choose from
Main Features
  • Professional certificates of completion
  • University-level courses
  • Multiple Online degree programs
Datacamp
Pros
  • Great user experience
  • Offers quality content
  • Very transparent with their pricing
Main Features
  • Free certificates of completion
  • Focused on data science skills
  • Flexible learning timetable

Name-Value Pairs for HTML dl

Before HTML5, the name of the dl element was deciphered as an HTML definition list. The update to a description list made the element's purpose clearer and also broader: the pair does not necessarily have to include any explanation, as long as there is a name-value pair in sight.

The rules for name-value pairs are flexible: there doesn't have to just be one of each. Check the example below to get the idea:

Example
<h3>One name, one value:</h3>
<dl>
  <dt>BitDegree</dt>
  <dd>Gamified online education platform</dd>
</dl>

<h3>One name, multiple values:</h3>
<dl>
  <dt>BitDegree Learn</dt>
  <dd>Code theory</dd>
  <dd>Code examples</dd>
  <dd>Code editor</dd>
</dl>

<h3>Multiple names, one value:</h3>
<dl>
  <dt>BitDegree Learn</dt>
  <dt>BitDegree Courses</dt>
  <dt>BitDegree Gamified Experience</dt>
  <dd>Tools needed to become a great developer</dd>
</dl>

Warning: do not use HTML dl for dialogues! While this use was suggested in HTML4, it is now deprecated, as you are not describing the speaker in any way.

Browser support

Browser image
Chrome
All
Browser image
Edge
All
Browser image
Firefox
1+
Browser image
IE
All
Browser image
Opera
All
Browser image
Safari
All

Mobile browser support

Browser image
Chrome
All
Browser image
Firefox
4+
Browser image
Opera
All
Browser image
Safari
All

Latest Udacity Coupon Found:

Verified STAFF PICK

75% OFF COURSES

Udacity Black Friday Offer

The best time to save on Udacity courses is now - follow this coupon to access a 75% Udacity Black Friday discount & enjoy learning at a very low cost!

Expiration date: 27/02/2021
3176 People Used
Only 97 Left
Rating
5.0