Definition Lists

We can define a description list using the <dl> tag element. Inside the <dl>..</dl> we need to define a description term using the <dt> tag. The term is usually some small text about something. Then, we can define the description descriptor to describe the term further using the <dd> tag.

Definition List makes use of following three tags.

  • <dl> − Defines the start of the list
  • <dt> − A term
  • <dd> − Term definition
  • </dl> − Defines the end of the list
<!DOCTYPE html>
<html>

   <head>
      <title>HTML Ordered List</title>
   </head>

   <body>
      <dl>
         <dt><b>HTML</b></dt>
         <dd>This stands for Hyper Text Markup Language</dd>
         <dt><b>CSS</b></dt>
         <dd>This stands for Cascading Style Sheet</dd>
         <dt><b>Javascript</b></dt>
         <dd>Language for eb</dd>
         <dt><b>Bootstrap</b></dt>
         <dd>free and open-source CSS framework</dd>
      </dl>
   </body>

</html>

OUTPUT:

Definition Lists

Order list vs Unorder list vs Definition list: Definition Lists

The main difference between ordered lists, unordered lists, and definition lists is the way they display the list items and the purpose they serve in structuring the content.

  • Ordered list: The <ol> element is used to create an ordered list, where each list item is marked with a number or letter. The order of the items is significant, and the numbering is done automatically by the browser. This element is useful when the order of the items is important and needs to be presented in a specific sequence.
  • Unordered list: The <ul> element is used to create an unordered list, where each list item is marked with a bullet. The order of the items is not significant, and the items are typically presented in no particular order. This element is useful when the order of the items is not important and the items need to be presented in a simple and easy-to-read format.
  • Definition list: The <dl> element is used to create a definition list, where terms and their corresponding definitions are grouped together. The <dt> element is used to define the term, and the <dd> element is used to describe the term. This element is useful when the items need to be presented in a format that clearly defines the relationship between the term and its definition.

All the above lists are semantic elements, which provide meaning to the structure of the content. They make it easier for search engines and assistive technologies to understand the purpose of the content, making it easier for users to find and navigate the information they need.

Definition Lists Definition Lists