Uses for Definition Lists

106 5

What is a Definition List?


A definition list is a list of items with two parts: a term and a description. You create them using the DL, DT, and DD tags. Most people think of using definition lists only for glossaries and dictionary style entries such as:
<dl>
  <dt>CSS</dt>
  <dd>Cascading Style Sheets</dd>
  <dt>HTML</dt>
  <dd>HyperText Markup Language</dd>
</dl>

But that is just the beginning. In fact, definition lists can be useful in grouping together any number of things that have two parts to them.

Here are some examples of how you can expand your use of definition lists.

Address List with a Definition List


An address or phone list is just a group of items typically sorted by name. You can collect all that information in a definition list. For example:
<dl>
  <dt>Name</dt>
  <dd>Address</dd>
  <dd>Phone</dd>
</dl>

Screenplay or Dialog with a Definition List


You can mark up a dialog in HTML using a definition list. Use the DT tag for the name of the person speaking, and the DD tag for what they say.
<dl>
  <dt>Jennifer</dt>
  <dd>Let’s learn HTML!</dd>
  <dt>Students</dt>
  <dd>Hurray!</dd>
</dl>

Website Navigation Can Be Written with Definition Lists


If you are considering creating a multi-level navigation system for your website, a defintion list can help you. Put the top level navigation in DT tags, with the links below them in DD tags.
<dl>
  <dt>Home</dt>
  <dt>About Us</dt>
  <dd>Our Company</dd>
  <dd>Our History</dd>
  <dd>Our Executives</dd>
  <dt>Products and Services</dt>
  <dd>Products</dd>
  <dd>Services</dd>
  <dd>Where to Buy</dd>
</dl>


Other Uses for Definition Lists

  • lists of links with a description of each, such as a blogroll
  • photographs with details like the location, people in the photo, date it was taken, and a description
  • famous quotations and who said them
  • events listed by date
  • events with a description of the event including location, description, date, and time.
  • name=value pairs in programming descriptions
  • home inventory lists by room with what's in the room
  • anything you can think of that has a list of items with details that have a direct relationship to the items

Don't be afraid to use definition lists.
Source...
Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time

Leave A Reply

Your email address will not be published.