Click here to bookmark this site! Home | Contact | About | Site Map  
 

Quick Menu

About HTML
Lesson 1
Lesson 2
Lesson 3
Lesson 4
Lesson 5
Lesson 6
Lesson 7
Lesson 8
Lesson 9
Lesson 10
Lesson 11
Lesson 12
Lesson 13

Advanced

 

11. Definition Lists

Yet another variety of lists.

In lesson 6 we learnt how to create two types of lists: ordered <ol>...</ol> and unordered <ul>...</ul> lists. Now we are going to learn a third variety, the definition list. Unlike the lists we learnt earlier, the definition list marks its entries not with a bullet marker or a number, but by its pattern of indentation.

The format for a definition list tag is:


<dl>
  <dt>  title1 </dt> 
  <dd>  definition1 </dd> 
  <dt>  title2 </dt> 
  <dd>  definition2 </dd> 
                :
                :
                :
  <dt>  titleN </dt> 
  <dd>  definitionN </dd> 
</dl>    
Google

Web
Eazy HTML

Site Stats

There are 2 users online
click to see where

70,168 total unique visitors
231,548 total pageviews
85 visitors in the last 24 hours
79 total visitors today
221 pageviews today
This page has been visited 2,420 times

get this script
Most users online at once:
41 on 04/10/2005

Valid CSS!

Valid XHTML 1.0!

The <dl> .... </dl> tags include alternating pairs of titles <dt> ... </dt> and definitions <dd> ... </dd>. A Web browser will generate the list with each definition indented to offset it from the title.

The above example would look like this in your browser.

Example
title1
definition1
title2
definition2
titleN
definitionN

The definition list might be used as a glossary; but for our example we will use it to create a short bibliography.

  1. Open Your HTML file, index.htm in your text editor.
  2. After the introduction and before the Venus heading enter this code:
    <h3>Bibliography</h3>
    <p>Check your local book store for these Travel books:</p>
    <dl>
    <dt>Palmer & Dent (1997). </dt>
    <dd><i>Volcanic Explosions: Venus Miracle wonders.</i> 
    City Of Angels: Bruce &amp; Ursula.</dd>
    
    <dt>courser de jason (2004) </dt>
    <dd><i>Venus de plan&eacute;te et ses &Eacute;ruptions.</i>
    Paris: Masson</dd>
    </dl>
     
    Notice We used some of the Special Characters for the ampersand symbol ("&") in the first reference and for the accent marks in the second reference. If you are unfamiliar with the HTML special characters, see lesson 10
  3. Save and Reload your work.

CHECK YOUR WORK
Here is an EXAMPLE of what your document should appear like, you can close the window once you have compared your work.

PRACTISE
In your own HTML document, you may want to add some more lists and or references using the definition list format.

<dl> ... </dl> <dt> ... </dt> <dd> ... </dd>

Top of page | Previous Lesson| Lessons Index | Next Lesson


Copyright © 2004 - EazyHTML.com