Lesson 3.5
Lists
Lists are used to
group data logically. They can be added
to the HTML document to group related information together
For example,
Roses
Sunflowers
Orchids
Apples
Oranges
Daffodils
Mangoes
Can be grouped into lists as follows:
Fruits
Apples
Mangoes
Oranges
Flowers
Daffodils
Orchids
Roses
Sunflowers
The types
of lists that
can be inserted
into an HTML
document are:
Ø Unordered lists
Ø Ordered lists
Ø Definition lists
3. 5. 1 Unordered List
This is the
simplest type of
list that can
be added to
HTML document. An
unordered list is a “bulleted list”. The
items are prefixed with bullets. The
list is enclose
within unordered list
tags <UL>.. </UL>.
Each item in the list is marked with a list <LI> tag, where, LI Stands
for List Item. The close </LI> tag is optional.
Figure 3.6: Output of Example 6
We can
create nested lists to indicate subgroups of information.
Figure 3.7:
Output of Example 7
The TYPE
attribute can be used to
format the bullets
that are displayed
with the list
items.
The TYPE attribute is not displayed in Internet Explorer
3.5.2
Ordered Lists
Ordered lists are
enclosed within <OL>. . </OL> tags. Ordered lists also display lists items.
The difference is
that the lists
items are displayed
with an automatically
generated sequence
Figure 3.8: Output of Example 8
We can
put attributes in order
to define the
numbering system that
is generated for
the list items.
The START attribute
specifies the starting
number of the list.
Figure 3.9:
Output of Example 9
We can nest
ordered lists just as we do unordered
lists. In addition,
we can nest
ordered lists within
unordered lists and
vice versa.
Figure 3.10: Output of
Example 10
Comments
Post a Comment