AlfieWebDevTips Homefor new and experienced developers
[Home Home] [Web Development Web Development ] [Code Generators Code Generators ] [Resources Resources ] [Contact Us Contact ] |WebDevTips Privacy Privacy |
WebDevTips Pick Of The Day : Beat The Spam Bots |

Print This Page

You are here : Home - Web Development - HTML - Lists - The Definition List

The Definition List

A definition list divides a listing into two parts - The main definition term and definition itself. Best explained in an example I think :)

Say for example you have a list of internet related terms, a heading and a description and you want a nice way of presenting it then take a look at the example below of how definition lists work.

One or more large structured sets of persistent data, usually associated with software to update and query the data. A simple database might be a single file containing many records, each of which contains the same set of fields where each field is a certain fixed width.
To indiscrimately send large amounts of unsolicited e-mail meant to promote a product or service. Spam in this sense is sort of like the electronic equivalent of junk mail sent to "Occupant".

Here's a smaller example.

Definition Title
Definition Data
Definition Title
Definition Data

And here's the html

    <dt>Definition Title</dt>     
        <dd>Definition Data</dd> 
    <dt>Definition Title</dt>     
        <dd>Definition Data</dd> 

The Tags

<dl> Open the Definition List 
    <dt> </dt> The Definition Title goes between these tags 
        <dd> </dd> The Definition Data goes between these tags 
</dl> Close the Definition List

The dir attribute

The default value if none specified is the same as <dl dir="ltr"> - left to right. So, <dl dir="rtl"> is right to left :)

The dir attribute is the only attribute that applies to a definition list. Definition lists aren't incremental nor do they produce bullet points but they are very useful for formatting the above types of data.

You might also want to look at this article about nesting lists

I hope you have found my guide to lists useful and not too boring. If you have any comments, good or bad, about this guide then please contact me. All comments are greatly appreciated. Thanks... Andy

a look at lists | un-ordered list | ordered list
definition list

Why not discuss this article in our forum?
Other related guides : webpage basics | forms


[back to top of page]   

[labelled with icra -  - this link will open in a new window] [RSS Content]

[Copyright © WebDevTips]