Definition Lists
September 17, 2001
Lastly, definition lists are also used in Curl, which work in a slightly different way to the other two types
of list. In HTML you would use the <dl> (definition list), <dt> (definition term) and <dd> (definition
description) elements. The <dl> element is the outermost container and it contains a set of terms and
related descriptions for each terms.
Definition lists are used when you wish to create a set of bullets using a different text term for each
separate one. It typically worked this way in HTML:
<dl>
<dt>HTML</dt>
<dd>Hyper text markup language</dd>
<dt>JavaScript</dt>
<dd>Client-side Scripting Language</dd>
<dt>Flash</dt>
<dd>Tool for writing multimedia extensions</dd>
<dt>Curl</dt>
<dd>The replacement for all of the above!</dd>
</dl>
Curl has its own syntax that works similarly to HTML:
{definition-list
{term ...}
{definition ...}
}
The definition-list format is used like the <dl> element to encompass all of the terms and
descriptions. The expressions contained within are used to define the terms and descriptions.
If we wanted to translate the above example into Curl, we would do the following:
|| definitionlist.curl
{curl 1.7 applet}
{applet license = "development"}
{definition-list
{term HTML}
{definition Hyper text markup language}
{term JavaScript}
{definition Client-side Scripting Language}
{term Flash}
{definition Tool for writing multimedia extensions}
{term Curl}
{definition The replacement for all of the above!}
}
This would define four separate terms, each with its own description. The above code will display like
this in a browser window:
The definition-list format is also capable of taking any of the character options, such as color or
font-weight to alter the appearance of the list:
{definition-list color="blue",
{term HTML}
{definition Hyper text markup language}
etc ...
This would alter the appearance of the whole list. If you wanted it to only apply to individual items,
such as single heading, then you would only need to alter the term format as follows:
{definition-list
{term color="blue",HTML}
{definition Hyper text markup language}
etc ...
Lists
Early Adopter Curl
Table Text Formats
|