|
Creating Lists Using Various Tags
HTML
supports unnumbered, numbered, and definition
lists. You can nest lists too, but use this
feature sparingly because too many nested
items can get difficult to follow.
Unnumbered Lists
To make an unnumbered,
bulleted list,
•
Start with an opening list <UL> (for
unnumbered list) tag
• Enter the <LI> (list item)
tag followed by the individual item; no
closing </LI> tag is needed
• End the entire list with a closing
list </UL> tag
Below
is a sample three-item list:
<UL>
<LI> graphic design
<LI> web design
<LI> illustration
</UL>
The output is:
- graphic
design
- web
design
- illustration
The
<LI> items can contain multiple
paragraphs. Indicate the paragraphs with
the <P> paragraph tags.
Numbered
Lists
A numbered list (also called an ordered
list, from which the tag name derives)
is identical to an unnumbered list, except
it uses <OL> instead of <UL>.
The items are tagged using the same <LI>
tag. The following HTML code:
<OL>
<LI> printing
<LI> stationery
<LI> direct marketing
</OL>
produces this formatted output:
- printing
- stationery
- direct
marketing
Definition
Lists
A definition list (coded as <DL>)
usually consists of alternating a definition
term (coded as <DT>) and a definition
description (coded as <DD>). Web browsers
generally format the definition on a new
line and indent it.
The following is an example of a definition
list:
<DL>
<DT> Binding or Bindery
<DD> Processes using glue, wire staples, thread or mechanical clasps to hold pages together.
<DT> Bleed
<DD> Extension (1/8") of image areas printed beyond the trim size of a sheet or page. This allows
the image to spill off the edge of the page.
</DL>
The output looks like:
- Binding
or Bindery
- Processes
using glue, wire staples, thread or mechanical
clasps to hold pages together.
- Bleed
- Extension
(1/8") of image areas printed beyond
the trim size of a sheet or page. This
allows the image to spill off the edge
of the page.
-
The
<DT> and <DD> entries can contain
multiple paragraphs (indicated by <P>
paragraph tags), lists, or other definition
information.
Nested
Lists
Lists can be nested. You can also have a
number of paragraphs, each containing a
nested list, in a single list item.
Here is a sample nested list:
<UL>
<LI> A few New England states:
<UL>
<LI> Vermont
<LI> New Hampshire
<LI> Maine
</UL>
<LI> Two Midwestern states:
<UL>
<LI> Michigan
<LI> Indiana
</UL>
</UL>
The nested list is displayed as:
- A
few New England states:
- Vermont
- New
Hampshire
- Maine
- Two
Midwestern states:
|