Skip to content
Related Articles

Related Articles

How to define a term or name in a definition list using HTML5 ?
  • Last Updated : 08 Mar, 2021

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:

My Personal Notes arrow_drop_up
Recommended Articles
Page :