|
To access the contents, click the chapter and section titles.
HTML 4.0 Sourcebook
In addition to the standard attributes, DL can take the optional attribute COMPACT, to signify that the list should be rendered in a physically compact waythis attribute takes no value. This is useful for compacting a list of small items or to compact a large list that would be easier to read if rendered in a compact manner. This tends to close up text, for example by placing the DT and DD text content on the same line. COMPACT is understood by Netscape Navigator 3/4 and Internet Explorer 4. Figures 6.25 and 6.26 show an example of a DL list, and illustrate the effect of COMPACT on list rendering. Figure 6.25 HTML example document illustrating the DL glossary list elements, and a UL unordered list nested inside a glossary list. Figure 6.26 shows this document as displayed by Internet Explorer 4. <HTML> <HEAD><TITLE> Example of Glossary List elements </TITLE> </HEAD><BODY BGCOLOR=white> <H2> Example Glossary Lists </H2> <P>The third <B>DD</B> has an unordered (<B>UL</B>) list inside it. Note that the first term (<B>DT</B>) does not have a matching description (<B>DD</B>). This is perfectly legal. You can use <B>BR</B> elements to add extra vertical spacing -- here it is done after the first <B>DT</B>.</P> <HR NOSHADE> <DL> <DT>Things to do: <BR><BR> <DT>Things to Avoid: <DD>Writing examples for HTML books that make you look like an idiot! In particular, spelling your wifes name incorrectly is not a good idea. <DT>Things to worry about: <DD>People you should never let format lists include: <UL> <LI>Bozo the Clown <LI>Uncle Fester <LI>Knights that go nii </UL> as they generally do a poor job. </DL> <HR NOSHADE> <TABLE CELLPADDING=3 CELLSPACING=6WIDTH=100%> <TR><TD BGCOLOR=#dddddd VALIGN=top WIDTH=50%> <H3>A Simple DL List</H3> <DL> <DT>Etc. <DD>Et Cetera <DT>HTTP <DD>HyperText Transfer Protocol <DT>HTML <DD>HyperText Markup Language </DL> </TD><TD BGCOLOR=#dddddd VALIGN=top WIDTH=50%> <H3>Same List -- With <B>COMPACT</B></H3> <DL COMPACT> <DT>Etc. <DD>Et Cetera <DT>HTTP <DD>HyperText Transfer Protocol <DT>HTML <DD>HyperText Markup Language </DL> </TD></TR></TABLE></BODY></HTML>
DT Element: Term in a Glossary List
The DT element contains the term part of a glossary or description list entry. The contents of a DT element should be shorttypically, a few words, and certainly shorter than a line. The element can contain standard character markup, images, line breaks, and hypertext anchors, as well as form input elements. The DT element is not empty, but the terminating </DT> is optional, as it is implied by the start of another <DT> or <DD> element or by the </DL> ending the list. DD Element: Description in a Glossary List
The DD element gives the description corresponding to the previous DT element or elements. It can be a long description, broken into paragraphs and containing other lists, FORM s, quotations, and so on. A DD element should follow a DT element and should not occur alone. Most browsers render DD content a line below and slightly indented relative to the DT content. This may be changed if the DL element took the COMPACT attributein this case, the DD content may be tab-indented relative to the DT content, and on the same line. DD is not empty, but the terminating </DD> is optional, since the end is implied either by the <DT> or <DD> tag starting another element or by the </DL> tag terminating the list. OL Element: Ordered List
OL defines an ordered list. Each item in the list is contained within an LI (list item) elementLI elements are the only elements that can appear inside OL. Items can be paragraphs of text, but should be kept reasonably short, as otherwise, the idea of a list is lost. If the list items are big, perhaps it is not really a list: Try paragraphs with appropriate section headings. A typical ordered list is shown in Figures 6.27 and 6.28. A browser indicates item ordering by numbering the items, by assigning them ascending letters, et cetera. OL can take three attributes: COMPACT to render the list in compact format, and TYPE and START to control how items are numbered and ordered.
UL Element: Unordered List
|
Products | Contact Us | About Us | Privacy | Ad Info | Home
Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement. |