How to make a description list in HTML?

by dee_smith , in category: HTML/CSS , 2 years ago

How to make a description list in HTML?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

by rubie_wisoky , 2 years ago

@dee_smith  The description list is created using <dl> element. 


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
  </head>
  <body>
    <dl>
      <dt>Coffee</dt>
      <dd>Hot drink</dd>
      <dt>Milk</dt>
      <dd>Cold drink</dd>
    </dl>
  </body>
</html> 

Member

by kenton , 7 months ago

@dee_smith 

The above HTML code demonstrates how to create a description list using the element. Inside the element, you can use the element to define the term (or description term), and the element to define the description (or description details).


In the provided example, there are two terms listed: "Coffee" and "Milk". These terms are defined using the element. Each term is followed by its respective description defined using the element. In this case, "Hot drink" is the description for "Coffee", and "Cold drink" is the description for "Milk".


To create your own description list, simply replace the terms and descriptions within the and elements to suit your needs.