The <dl> tag is used in place of the ul and ol tags. And then the <dt> tag is used for each definition term and the <dd> tag is used for each definition description.
The following HTML:
<dl>
<dt>This is a term (inline elements only)</dt>
<dd>And this is the definition description, detailing the definition of the term.</dd>
<dt>Chocolate</dt>
<dd>A sweet creamy substance made from the cocoa bean that to some is overwhelmingly irresistible - especially to women at least once a month.</dd>
</dl>
Produces:
- This is a term (inline elements only)
- And this is the definition description, detailing the definition of the term.
- Chocolate
- A sweet creamy substance made from the cocoa bean that to some is overwhelmingly irresistible - especially to women at least once a month.
- Racket (Term 1)
- Racquet (Term 2)
- An item of sporting equipment held in the hand to help hit a feathered object over a net about head height.
Hhhhmmm... it really does need a bit of formatting with CSS, for example:
dl.mydef dt {
font-weight:bold;
}
dl.mydef dd {
margin-left:20px;
margin-bottom:10px;
}
To produce this, using <dl class="mydef"> on the first line:
- This is a term (inline elements only)
- And this is the definition description, detailing the definition of the term.
- Chocolate
- A sweet creamy substance made from the cocoa bean that to some is overwhelmingly irresistible - especially to women at least once a month.
- Racket (Term 1)
- Racquet (Term 2)
- An item of sporting equipment held in the hand to help hit a feathered object over a net about head height.
Back to top
Further reading...
[Home]