HTML and CSS Reference
In-Depth Information
◗
3.
Click the
Preview Code
button. Figure 1-24 shows how the browser renders the
ordered list contents.
Figure 1-24
Viewing an ordered list
code for an ordered list
by default, browsers display
ordered lists as numbered lists
By default, entries in an ordered list are numbered, with the numbers added automati-
cally by the browser.
Unordered Lists
To mark a list in which the items are not expected to occur in any specifi c order, you
create an
unordered list
. The structure of ordered and unordered lists is the same, except
that the list items for an unordered list are nested within the
ul
element, as follows:
<ul>
<li>
item1
</li>
<li>
item2
</li>
...
</ul>
You'll practice creating an unordered list with the demo page.
To create an unordered list:
◗
1.
Delete the HTML code in the left box and replace it with the following:
<ul>
<li>Basic Stick</li>
<li>Flower Stick</li>
<li>Master Stick</li>
<li>Glow Stick</li>
</ul>
◗
2.
Click the
Preview Code
button. Figure 1-25 shows how the browser renders the
unordered list.