HTML <dl> / <dt> / <dd> tags
- closing tag
- required
- void element
- no
- lives inside
- <body>, like any list
- typically holds
- <dt> terms, each followed by one or more <dd> descriptions
Where it goes
<dl> wraps alternating <dt> and <dd> tags. One term can have several descriptions, and several terms can share one description.
Example
<dl>
<dt>HTML</dt>
<dd>The structure of a page: what things are.</dd>
<dt>CSS</dt>
<dd>The look of a page: how things appear.</dd>
</dl>Open this example in the editor →
Common mistakes
- Using it for layout because the indent looks nice. If the items are not term and description pairs, it is the wrong list.
- Putting <li> inside it. <dl> holds <dt> and <dd> only. <li> belongs to <ul> and <ol>.
- Using a <table> for simple name and value pairs. Two columns with no rows to compare is a <dl>. A table is for data with real rows and columns.