|
Section VI: HTML Lists Lesson 6-1: Unordered Lists
In this lesson you will learn how to create unordered lists.
If you have read the introduction to this section, you understand why it is not practical or possible to
use line breaks BR and spaces to align text in lists.
If you have not read the introduction to this section,
go back one page. Make sure you understand the information there before continuing.
It is easy to create different kinds of lists in HTML. One of the most common
lists is the unordered list, sometimes called a bulleted list. You use the unordered list element for lists
of items which have no special order. Each item is marked with a "bullet" character.
Here is an example of an unordered list:
The dots on the left of each item are called bullets in English. You can see that list items are
also indented and correctly aligned. This list is created using no line break tags or space codes.
The HTML tags for creating unordered lists are simple and easy to remember.
A pair of UL tags is used to create the list.
UL, of course, stands for Unordered List.
An LI tag is placed before each list item.
LI, of course, stands for List Item. The HTML code for the list above looks like this:
Today's shopping list: UL
LIbread
/LI
LImilk
/LI
LIeggs
/LI
/UL
|
Everything inside the UL
tags is indented. Usually, you don't want to indent the title, so if your list has a title, it
is not usually placed inside the list itself. Also notice that the
LI
tag can be used as an empty element, or a container.
A closing /LI
tag can be used, but it is optional. By the way, have you noticed that the Review section at the
bottom of each lesson page is created with unordered list tags.
The default symbol used in unordered lists is a small "disk".
Small squares or circles can also be used. The symbol is set using the
TYPE="disc/circle/square" attribute of the opening UL tag.
Here are some examples:
ul type="disk"
|
ul type="square"
|
ul type="circle"
|
|