|
To access the contents, click the chapter and section titles.
HTML 4.0 Sourcebook
UL defines an unordered list of items; a graphical browser will present each list item with a special leading symbol, such as a bullet or asterisk. Each item in a UL list is contained within an LI (list item) elementLI elements are the only things that can appear inside a UL. Items can be paragraphs of text, but should be kept reasonably short; 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. The UL element can take two optional attributes, namely:
Figures 6.27 to 6.30 show examples of unordered lists. Figure 6.27 HTML example document illustrating UL and OL lists and the nesting of list elements. Figure 6.28 shows this document as displayed by the Internet Explorer browser. <HTML> <HEAD> <TITLE> Example of Regular List elements </TITLE> </HEAD> <BODY> <H2> Examples of Regular Lists </H2> <H3> Ordered Lists </H3> <P>This shows an ordered list, with another ordered list nested within it. <OL> <LI>First item -- items can contain images, blockquotes, and other lists, among other things <LI>A Second item in the list <LI VALUE=6>And a third item (but a <B>VALUE</B> attribute sets it to numeral 6). And now.... a nested ordered list, with the type attribute <B>TYPE</B>=i: <OL TYPE=i START=2> <LI>The first sub-item <LI>The second sub-item, and so on..... </OL> </OL> <H3> Unordered Lists </H3> <P>This examples illustrates and unordered list containing another unordered list. <UL> <LI>A list item <LI>Another list item; again these can contain IMG elements, paragraphs, and so on <LI>List items can also contain lists, for example: <UL> <LI TYPE=circle>An item in the list <LI TYPE=square>Something else that is important, and so on </UL> Which is simply a list within a list </UL> </BODY> </HTML>
DIR Element: Directory List
DIR defines a directory lista list of short items, each usually no more than about 20 characters. If possible, a browser may display the items in columns across the screen, rather than one above the other (most browsers do not do this, however, and format DIR and UL lists identically). Each item in a DIR list is contained within an LI (list item) elementLI elements are the only things that can appear inside a DIR list. An example of a directory list is shown in Figures 6.29 and 6.30. MENU Element: Menu List
MENU defines a list of short menu items, each item preferably less than a sentence long. MENU is designed to work like UL but to be formatted in a more compact manner similar to a <UL COMPACT> list, except that formatting may be optimized to favor short list items (most browsers do not do this, however, and format MENU and UL lists identically). Each item in a MENU list is contained within an LI (list item) elementLI elements are the only things that can appear inside a MENU list. Figures 6.29 and 6.30 give an example of a MENU list. Figure 6.29 HTML example document illustrating the MENU and DIR lists. Figure 6.30 shows this document as displayed by the Netscape Navigator browser. <HTML><HEAD> <TITLE> More Examples of Regular Lists </TITLE> </HEAD> <BODY> <H2 ALIGN=center> Lists, Lists and Yet More Lists </H2> <H3> Regular UL Lists </H3> <UL> <LI>A list item. <LI>another list item <LI>and still more items <LI>What ... still more? </UL> <HR SIZE=5 WIDTH=20%> <H3> DIR Lists </H3> <DIR> <LI>Abraham - Carbon <LI>Cardshark - Elegant <LI>Elegiac - Food <LI>Foot - Hogs </DIR> <HR SIZE=5 WIDTH=20%> <H3> MENU Lists </H3> <MENU> <LI>First item <LI>Second item <LI>Third item <LI>Fourth item </MENU> </BODY></HTML>
LI Element: List Item
LI marks a list item within DIR, MENU, OL, or UL lists. The item can contain text, character markup, and hypertext anchors, as well as subsidiary lists and text blocks. LI supports two attributes for defining the type of the bullets in unordered lists, and for controlling numbering in ordered lists. These are:
|
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. |