The DL , DT , DD , DIR , and Elements


The <DL> , <DT> , <DD> , <DIR> , and <MENU> Elements

The <DL> , <DT> , and <DD> elements enable you to set up definition lists, which list terms and their definitions in pairs. You create a definition list with the <DL> element, and create items in this list using both the <DT> element to define a term and the <DD> element to give the term's definition. The definition usually appears indented under the term being defined. Here's an example:

(Listing 14-08.html on the web site)
 <HTML>      <HEAD>          <TITLE>              A Definition List          </TITLE>      </HEAD>      <BODY>          <H1>              Creating A Definition List          </H1>          Buying a computer? Let's consider:  <DL>   <DT>Price<DD>Keep this low!   <DT>CPU Speed<DD>Processor speed   <DT>RAM<DD>Random access memory   <DT>Disk space<DD>Get plenty!   <DT>CD-ROM/DVD speed<DD>Access speed for your CDs   </DL>  </BODY>  </HTML> 

You can see this page in Figure 14.4.

Figure 14.4. Using a definition list.

graphics/14fig04.gif

There are even more list elementsthe <DIR> and <MENU> elementsbut they are deprecated in HTML 4.01 and are just treated as <UL> elements. You can see the properties of the <DL> , <DT> , and <DD> elements in Table 14.6. Remember that JavaScript's core HTML properties, methods , and events, which we covered in Chapters 5 and 6, apply to the <DL> , <DT> , and <DD> elements as well.

Table 14.6. The Properties of the <DL> , <DT> , <DD> , <DIR> , and <MENU> Elements (See Chapters 5 and 6 for the JavaScript core HTML properties, methods, and events that also apply to these elements.)

Property

NS2

NS3

NS4

NS6

IE3a

IE3b

IE4

IE5

IE5.5

IE6

compact

     

x

   

x

x

x

x

 

Read/write

 

Sets or gets a Boolean value indicating whether the list should be compacted by removing extra space between list objects. The COMPACT attribute is deprecated in HTML 4.01. In the Internet Explorer, this property was added for <DIR> and <MENU> elements in version 6.0.



Inside Javascript
Inside JavaScript
ISBN: 0735712859
EAN: 2147483647
Year: 2005
Pages: 492
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net