HTML
Tag


The dl element in HTML is used to define description list. In HTML5, the <dl> is used to define a description list, whereas the <dl> in HTML4 defined definition list.

Let us now see an example to implement the <dl> tag −

Example

 Live Demo

<!DOCTYPE html>
<html>
<body>
<h2>Sports</h2>
<dl>
   <dt>Football</dt>
      <dd>It is played by 250 million players in over 200 countries.</dd>
   <dt>Cricket</dt>
      <dd>It is a bat-and-ball game played between two teams of eleven players on a field.</dd>
   <dt>Hockey</dt>
      <dd>There are many types of hockey such as bandy, field hockey, and ice hockey.</dd>
   <dt>Golf</dt>
      <dd>It is a club-and-ball sport in which players use various clubs to hit balls into a series of holes on a course in as few strokes as possible.</dd>
</dl>
</body>
</html>

Output

In the above example, we have set the <dl> to set the description list −

<dl>
   <dt>Football</dt>
      <dd>It is played by 250 million players in over 200 countries.</dd>
   <dt>Cricket</dt>
      <dd>It is a bat-and-ball game played between two teams of eleven players on a field.</dd>
   <dt>Hockey</dt>
      <dd>There are many types of hockey such as bandy, field hockey, and ice hockey.</dd>
   <dt>Golf</dt>
      <dd>It is a club-and-ball sport in which players use various clubs to hit balls into a series of holes on a course in as few strokes as possible.</dd>
</dl>

The <dt> element above defines a term in the definition list, whereas the <dd> also defines a term, but you can add links, images, line breaks inside the <dd>.

Updated on: 30-Jul-2019

39 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements