HTML <dl> Tag
Example
A description list, with terms and descriptions:
<dt>Coffee</dt>
<dd>Black hot drink</dd>
<dt>Milk</dt>
<dd>White cold drink</dd>
</dl>
HTML Description List | HTML Definition List
HTML Description List or Definition List displays elements in definition form like in dictionary. The <dl>, <dt> and <dd> tags are used to define description list.
The 3 HTML description list tags are given below:
- <dl> tag defines the description list.
- <dt> tag defines data term.
- <dd> tag defines data definition (description).
Output:
<dl>: The Description List element
The <dl> HTML element represents a description list. The element encloses a list of groups of terms (specified using the <dt> element) and descriptions (provided by <dd> elements). Common uses for this element are to implement a glossary or to display metadata (a list of key-value pairs).
Flow content, and if the <dl> element's children include one name-value group, palpable content. |
Either: Zero or more groups each consisting of one or more <dt> elements followed by one or more <dd> elements, optionally intermixed with <script> and <template> elements. |
None, both the starting and ending tag are mandatory. |
Any element that accepts flow content. |
No corresponding role |
group, list, none, presentation |
HTMLDListElement |
<dt>: The Description Term element
The <dt> HTML element specifies a term in a description or definition list, and as such must be used inside a <dl> element. It is usually followed by a <dd> element; however, multiple <dt> elements in a row indicate several terms that are all defined by the immediate next <dd> element.
The subsequent <dd> (Description Details) element provides the definition or other related text associated with the term specified using <dt>.
None. |
Flow content, but with no <header>, <footer>, sectioning content or heading content descendants. |
The start tag is required. The end tag may be omitted if this element is immediately followed by another <dt> element or a <dd> element, or if there is no more content in the parent element. |
A <dl> or (in WHATWG HTML, W3C HTML 5.2 and later) a <div> that is a child of a <dl>. This element can be used before a <dd> or another <dt> element. |
term |
listitem |
HTMLElement Up to Gecko 1.9.2 (Firefox 4) inclusive, Firefox implements the HTMLSpanElement interface for this element. |
HTML Tags
This is a list of tags used in the HTML language. Each tag starts with a tag opener (a less than sign) and ends with a tag closer (a greater than sign). Many tags have corresponding closing tags which identical except for a slash after the tag opener. (For example, the TITLE tag).Some tags take parameters, called attributes. The attributes are given after the tag, separated by spaces. Certain attributes have an effect simply by their presence, others are followed by an equals sign and a value. (See the Anchor tag, for example). The names of tags and attributes are not case sensitive: they may be in lower, upper, or mixed case with exactly the same meaning. (In this document they are generally represented in upper case.)
Currently HTML documents are transmitted without the normal SGML framing tags, but if these are included parsers will ignore them.