Maddog's HTML for Real People Chapter 8, Lesson 7


[INDEX] Ch 8, L 7 - Definition Lists

If you already know how to create a definition list in HTML, and when they are useful, you can skip this lesson.

One specialized kind of list that is occasionally useful is the "definition list". In this type of list, each element in the list contains a pair of relevant text fragments. The first in the pair, called the Definition Term, goes in the first column or on the first line. The second text fragment, called the Definition Definition (clever, huh, clever, huh?), goes in the second column, or indented on the second line (depending on the browser).

As with the unordered and ordered lists, we have a tag pair which tells the browser that "this is a list". For the Definition List this is:

<DL> </DL>

But instead of list items (using the '<LI>;' tag), we have separate tags for the Definition Term:

<DT>

and the Definition Definition:

<DD>

As you can see, the <DT> and <DD> tags are standalone tags (that is, they need no closing tag), while the 'DL' list tag is a tag pair, requiring both the opening <DL> tag and the closing </DL> tag.

The general format for an definition list is:

<DL>
<DT> name of list element 1 (definition term)
<DD> definition of list element 1
<DT> name of list element 2 (definition term)
<DD> definition of list element 2
</DL>

Let's see how it looks in real HTML:

HTML Source Code Follows:


<DL >

<DT>hot-shot
<DD>somebody who can build a definition list for a web page
<DT>fast-burner
<DD>somebody who learns to write HTML in only weeks
<DT>weenie
<DD>the author of this lame demo

</DL>

(End of HTML Source Code)

Demonstration Follows:

hot-shot
somebody who can build a definition list for a web page
fast-burner
somebody who learns to write HTML in only weeks
weenie
the author of this lame demo

(Demonstration Ends)

Cool, huh? Not every browser handles definition lists the same way, but you get the general idea.


-PREVIOUS- -CHAPTER- -INDEX- -NEXT-

Overseer: Monty Northrup ... maddog@io.com ... leave e-mail ...
...to maddog 'n' miracles homepage...
TER>