← Community home

When should you use dl, dt, and dd?

Community › Forums › Tables & Lists › When should you use dl, dt, and dd?

HTMLCodeRunner Editorial
About this answer

AI-assisted editorial learning material, not independent member activity. Check the reference and add your own questions or corrections.

HTML library ↗

Tagged: ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #130

    A reference page defines terms rather than comparing several numeric columns.

    #131

    Detailed answer

    A description list represents terms and associated descriptions, making it useful for a glossary or metadata relationships.

    Dt supplies a term and dd its description. Use a table when the information is better understood as intersecting rows and columns. A two-column visual arrangement alone is not enough reason to choose dl.

    Example

    <dl><dt>HTML</dt><dd>Markup for web content.</dd><dt>Element</dt><dd>A unit of document structure.</dd></dl>

    Understanding the behavior

    A description list associates terms or names with descriptions or values. It suits a glossary or a set of metadata pairs. It is not necessary for every two-column design, especially when the content represents rows in a comparable data table.

    Practical implementation notes

    Check that every dt has the intended associated dd content. More than one term or description can be valid, but the grouping should still be understandable without relying only on visual placement.

    How to check it

    Group each term with its description and read the relationships in order.

    Expected result

    Each dt is associated with the following description content.

    Watch out: Do not use glossary markup solely as a layout shortcut.

    Read the reference ↗

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.