Definition Lists

Section 1 - Introduction
Section 2 - Basics
Section 3 - Next Level
      Lists
         Ordered
         Unordered
         Definition
         You Try It
      Basic Tables
      Advanced Text
      Marquee
      Meta
      Sounds
      Comments
Section 4 - Advanced
Section 5 - Publishing
Section 6 - Extras
Appendices
Definition Lists
TAGS USED: <dl> </dl> <dt> </dt> <dd> </dd>
Perhaps you've seen lists of definitions.There is a term that needs to be defined, and then definitions that follow. There is a specific type of list that can function as a dictionary list. Let's look at such a list and then dicuss how it was made.
cat (noun)
A fuzzy mammal.
A cute companion superior to the humans who it entertains. The cat was believed to be deity by Egyptians and other enlightened cultures.
A fierce demon complete with claws and teeth, capable of shredding furniture, clothing and skin.
A known allergen.
dog (noun)
A fuzzy mammal.
A cute companion loyal and subservient to humans. The dog was one of the earliest domesticated creatures.
A fierce demon complete with vicious teeth, capable of removing large chunks of skin.
A known allergen.
You will notice on this list that there are the terms that need to be defined and the definitions that follow. If you'll look, you'll notice four definitions for each of the two terms I chose. This is how a definition list works.

To begin a definition list, you start with the <dl> tag. This alerts the computer that the list is beginning. Understandably, you'll also need a </dl> tag. The definition list is not indented, but it is separated from the rest of the text by a space.

There are two parts that fit inside of a definition list. First, there is the defined term. In the example, cat (noun) and dog (noun) are the defined terms. They are labeled with the <dt> tags. So, the cat section is labeled <dt> cat (noun)</dt>

Each word is defined four times. Each definition's data must be labeled separately. It is given the <dd> tag. The section that reads a fuzzy mammal would be listed as:
<dd> a fuzzy mammal</dd>
So, if we put this whole thing together, we have this:
Code
<dl>
<dt>Cat (a noun thing)</dt>
<dd>Fuzzy Mammal</dd>
</dl>
What you see
Cat (a noun thing)
Fuzzy mammal
To add multiple definitions, you just need to add more <dd> tags under the <dt> tag.
Code
<dl>
<dt>Cat (a noun thing)</dt>
<dd>Fuzzy Mammal</dd>
<dd>Clawed Demon</dd>
</dl>
What you see
Cat (a noun thing)
Fuzzy Mammal
Clawed Demon
Adding other terms to be defined is easy too. If you keep them within the same list, the spacing will be good.
Code
<dl>
<dt>Cat </dt>
<dd>Fuzzy Mammal</dd>
<dd>Clawed Demon</dd>
<dt>Dog </dt>
<dd>Loyal Idiot</dd>
</dl>
What you see
Cat
Fuzzy Mammal
Clawed Demon
Dog
Loyal Idiot
You can modify these lists any way you see fit. The lists can be long or short, and can be found anywhere in the body of the page.

That's it. You know the basics of how to make lists. We'll come back to lists later when you've learned a few more things. It's good review and things get more complicated as we go along.
Back Home Forward