Collected by Elizabeth Janson Home Page |
|
Unordered lists (UL), ordered lists (OL), and definitions (DL)HTML offers authors several mechanisms for specifying lists of information. All lists must contain one or more list elements. Lists may contain:
<UL> <LI>Unordered information. UL and LI <LI>Ordered information. OL and LI <LI>Definitions. DL with DT and DD </UL> This list, for example, is an unordered list, created with the UL element. All list properties are inherited, and thus if applied to OL will inherit to list items inside that OL. Ordered ListsAn ordered list, created using the OL element, should contain information where order should be emphasized, as in a recipe. Possible values for the LI type attribute are summarized in the table below (they are case-sensitive):
Note that the type attribute is deprecated and list styles should be handled through style sheets. For example, using CSS, one may specify that the style of numbers for list elements in a numbered list should be lowercase roman numerals. In the excerpt below, every OL element belonging to the class "withroman" will have roman numerals in front of its list items. <STYLE type="text/css"> OL.withroman { list-style-type: lower-roman } </STYLE> <BODY> <OL class="withroman"> <LI> Step one ... <LI> Step two ... </OL>
Definition lists: the DL, DT, and DD elementsDefinition lists vary only slightly from other types of lists in that list items consist of two parts: a term and a description. The term is given by the DT element and is restricted to inline content. The description is given with a DD element that contains block-level content.Lists may also be nested and different list types may be used together, as in the following example, which is a definition list that contains an unordered list (the ingredients), an ordered list (the procedure) and ends with a definition:
This is the code used. <dl> <dt><strong>The ingredients:</strong></dt> <dd> <ul> <li>100 g. flour</li> <li>10 g. sugar</li> <li>1 cup water</li> <li>2 eggs</li> <li>salt, pepper</li> </ul> </dd> <dt><strong>The procedure:</strong></dt> <dd> <ol> <li>Mix dry ingredients thoroughly. <li>Pour in wet ingredients. <li>Mix for 10 minutes. <li>Bake for one hour at 300 degrees. </ol> </dd> <dt><strong>Notes:</strong></dt> <dd>The recipe may be improved by adding raisins.</dd> </dl>
See Page 2 for changing the bullets and colours, and Page 3 for spacing around the list
|
Email CSS begins here |
|
This page is part of Elizabeth Janson's web site
http://www.oocities.org/elizatk/index.html
Tetbury residents in the Eighteenth Century my Australian Family History and Barrie, our Family Poet. |