HTML HTML Tutorial HTML Forms HTML Graphics HTML Media HTML APIs HTML Tags



HTML Tag: dt

The HTML tag <dt> is used to define a term in a description list. It is used in conjunction with the <dl> and <dd> tags to create a list of terms and their definitions.

The <dt> tag is used to define the term being described in the list. It is typically followed by a <dd> tag, which contains the definition of the term. Multiple <dt> and <dd> tags can be used to create a list of terms and their definitions.

Example:

Here is an example of a description list using the <dt> tag:

HTML
Stands for Hyper Text Markup Language, the standard markup language used to create web pages.
CSS
Stands for Cascading Style Sheets, a language used to describe the presentation of a document written in HTML.
JavaScript
A programming language used to create interactive effects within web browsers.

In the example above, the <dt> tag is used to define the terms "HTML", "CSS", and "JavaScript". The <dd> tag is used to provide the definitions of each term.

Code Examples:

Here are some code examples of how to use the <dt> tag:

Example 1:

Using the <dt> tag to define a single term:

  
    <dl>
      <dt>Term</dt>
      <dd>Definition</dd>
    </dl>
  

Example 2:

Using multiple <dt> and <dd> tags to create a list of terms and their definitions:

  
    <dl>
      <dt>Term 1</dt>
      <dd>Definition 1</dd>
      
      <dt>Term 2</dt>
      <dd>Definition 2</dd>
      
      <dt>Term 3</dt>
      <dd>Definition 3</dd>
    </dl>
  

Conclusion:

The <dt> tag is an important part of creating description lists in HTML. It is used to define the terms being described in the list, and is typically followed by a <dd> tag, which contains the definition of the term. By using the <dt> tag in conjunction with the <dl> and <dd> tags, you can create a list of terms and their definitions that is easy to read and understand.

References:

Activity