DEV Community

Share Point Anchor
Share Point Anchor

Posted on • Originally published at sharepointanchor.com on

HTML <dt> Description Term Tag

The

tag
stands for Description term or definition term in HTML. This tag is used to define the name of a term in a definition list. It must be placed inside the
Description List
tag. The
tag is found within the tag.

Possible list to create
tag:

  • A single term followed by a single description.
  • A single term followed by multiple descriptions.
  • Multiple terms followed by a single description.
  • Multiple terms followed by multiple descriptions.

Estimated reading time: 4 minutes

Syntax:

The

tag always comes in pairs. It contains both an opening
tag
and closing tag. The content is written between these two tags.

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

Enter fullscreen mode Exit fullscreen mode

HTML
Tag Characteristics:

th, td{ padding: 20px; }

| HTML

tag | Defines a term in a description list. |
| Content categories | None. |
| Permitted content | Flow content. |
| Tag omission | It has both opening and closing tags . But, the end tag may be omitted if this element is immediately followed by another
element or a
element. |
| Permitted parents | It is a child element of
tag. This element can be used before a
tag. |
| Implicit ARIA role | Term |
| Permitted ARIA roles | List Items |
| DOM interface | HTML Element |

Sample of the HTML
Tag:


<!DOCTYPE html>
<html>
   <head>
      <title>Title of the Document</title>
   </head>
   <body>
      <h2>Example of HTML <dt> Tag</h2>
      <dl>
      <dt>HTML</dt>
      <dd>Hypertext Markup Language </dd>
      <dd>It is the language for authoring web documents.</dd>
      <dt>CSS</dt>
      <dd>Cascading Style Sheets</dd>
      <dd>It is the language for defining the styles and presentation of an HTML document.</dd>
      <dt> JavaScript</dt>
      <dd>A scripting language built-in to most browsers and designed to be used with web documents.</dd>
      </dl>
   </body>
</html>

Result:

Result

Download Sample File:

HTML-dt-TagDownload

Attributes:

The


tag supports both the global attributes and the event attributes.

Styling Methods for
Tag:

You can use the following CSS properties to style an HTML Description Term tag.

Properties to style the visual weight/emphasis/size of the text in
tag:

  • CSS font-style – This CSS property helps to set the font style of the text such as normal, italic, oblique, initial, inherit.
  • CSS font-family – This CSS property specifies a prioritized list of one or more font family names or generic family names for the selected element.
  • CSS font-size – This CSS property will help to set the size of the font.
  • CSS font-weight – This CSS property used to define whether the font should be bold or thick.
  • CSS text-transform – This CSS property will control the text case and capitalization.
  • CSS test-decoration – This CSS property specifies the decoration added to text such as text-decoration-line , text-decoration-color , text-decoration- style.

Styles to coloring the text in
Tag:

  • CSS color – This CSS property will specify the color of the text content and decorations.
  • CSS background-color – This CSS property helps to set the background color of an element.

Text layout styles for
Tag:

  • CSS text-indent – This CSS property is used to specify the indentation of the first line in a text block.
  • *CSS text-overflow * – This CSS property helps to describe how overflowed content that is not displayed should be signaled to the user.
  • CSS white-space – This CSS property describes how white-space inside an element is handled.
  • CSS word-break – This CSS property decides where the lines should be broken.

Other Properties for
Tag:

  • CSS text-shadow – This CSS property helps to add the shadow to text.
  • CSS text-align-last – This CSS property will set the alignment of the last line of the text.
  • CSS line-height – This CSS property defines the height of a line.
  • CSS letter-spacing – This CSS property helps to decide the spaces between letters/characters in a text.
  • CSS word-spacing – This CSS property specifies the spacing between every word.

Browser Support:

Browser Support

Related Articles:

The post HTML

Description Term Tag appeared first on Share Point Anchor.


Top comments (0)