A Complete Guide to Web Design

(やまだぃちぅ) #1
Lists 121

Formatting
Text

Lists

Web Design in a Nutshell, eMatter Edition

Setting the first number


If you want the list to start with some number (or letter value) other than 1, use
the start attribute to specify the first number, as shown in Figure 7-9.


Definition Lists


The third type of list supported by HTML is the definition list, which follows a
different structure than the other two. Definition lists consist of terms and defini-
tions (any amount of descriptive text to be associated with the term) as in a
glossary. In general, terms are positioned against the left edge of the page and
definitions are positioned on an indent.


Terms and definitions are block-level items, so line breaks will be added around
them, however, if you want extra space between terms and definitions, you must
insert

tags between them.


A definition list is designated by the

...
tags. Within the list, each term
is indicated with a
and its definition is marked with a
. Closing
and
tags may be safely omitted if style sheets are not in use. Figure 7-10
shows the display of a basic definition list and the code that created it.


Figure 7-8: Changing the numbering style with the TYPE attribute


Figure 7-9: Setting the first number in the list with the START attribute


<OL TYPE=A>... <OL TYPE=a>...

<OL TYPE=I>... <OL TYPE=i>...

<B>Preparation</B>
<OL START=23>
<LI>Dice the avocados
<LI>Peel and seed tomatoes
<LI>Finely slice the scallions
<LI>Mix in the black beans
</OL>
Free download pdf