Open In App

How to define a term or name in a definition list using HTML5 ?

Improve
Improve
Like Article
Like
Save
Share
Report

HTML5 provides a way to specify a term and definition associated with it in a formatted way. A description list (or a definition list in older versions) provides a systematic arrangement of a term and its definition.

The following tags are used for defining a definition list:

  • <DL>: This is the Definition List. It holds term and its definition as rows and data in tables
  • <DT>: This is the Definition Term. It holds the term to be defined.
  • <DFN>: This is the Definition Element. It holds the term being defined within the content.
  • <DD>: This is the Definition or Description. It holds the definition for a given term.

The below example illustrates the creation of definition lists.

Example: This example creates a definition list with 2 terms, Machine Learning and Artificial Intelligence with their respective definitions.

HTML




<html>
<body>
  <h1>Sample List</h1>
  <dl>
    <dt>
      <dfn>
        Machine Learning
      </dfn>
    </dt>
    <dd>Development of a system
      that is able to learn and adapt
      without it given any specific
      instructions.
    </dd>
    <dt>
      <dfn>
        Artificial Intelligence
      </dfn>
    </dt>
    <dd>Artificial intelligence refers
      to the simulation of intelligence
      that resembles human logic in machines.
    </dd>
    <dd>AI is the future of machines that 
      need to perform human tasks.
    </dd>
  </dl>
</body>
</html>


Output:


Last Updated : 08 Mar, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads