Definition lists
Let’s quickly examine how to mark up definition lists, because they are slightly different from ordered
and unordered lists. Instead of the single <li> element for the list items, you have two elements to
work with inside definition lists. These are <dt> for the definition’s title and <dd> for the definition’s
description.
<dl>
<dt>body</dt>
<dd>Holds content of the document</dd>
<dt>head</dt>
<dd>Holds additional information about the document</dd>
<dt>html</dt>
<dd>Root element of the document</dd>
</dl>
You can see the basic premise is what you’re already used to: a <dt> element wrapping the definition’s
title followed by a <dd> element wrapping the description, all held together by being enclosed inside
a definition list. Browsers will render this markup to look something like Figure 4-6.
0 comments:
Post a Comment