DL
The 'D' stands for description
.
I prefer to refer to it as definition
.
How to use it
<dl>
<dt>Term you seek to describe or define</dt>
<dd>First of one or more descriptions or definitions</dd>
<dd>Optional second of many descriptions for the same term</dd>
<dd>So on and so forth...</dd>
</dl>
Common structure
<dl>
<dt>Term</dt>
<dd>Description</dd>
<dt>Term</dt>
<dd>Description</dd>
</dl>
What I hear you saying
I'd like to layout each term-description pairing as a group. How might I do that?
Secret trick: enclose each pair in a <div>
<dl>
<div>
<dt>Term</dt>
<dd>Description</dd>
</div>
<div>
<dt>Term</dt>
<dd>Description</dd>
</div>
</dl>
Your challenge
Find
- Look through some of your code
- Find examples that fit this structure: term with descriptions
- Re-factor your code...
And replace
- Using
<div>
s or<span>
s? Upgrade to a<dl>
. - Using a heading or paragraph with
<ul>
s or<ol>
s? Upgrade to a<dl>
.
Learn something today? Keep up the habit with a fun game I made:
Fix a function! - 5 daily exercises to help you practice HTML, CSS and JavaScript
Top comments (1)
Really useful, I barely use
tag, but it has great use