Sams Teach Yourself HTML, CSS & JavaScript Web Publishing in One Hour a Day

(singke) #1
ptg16476052

78 LESSON 5: Organizing Information with Lists


Unordered Lists


Unordered lists are often referred to as bulleted lists. Instead of being numbered, each
element in the list has the same marker. The markup to create an unordered list looks just
like an ordered list except that the list is created by using <ul>...</ul> tags rather than
ol. The elements of the list are placed within <li> tags, just as with ordered lists.
Browsers have standardized on using a solid bullet to mark each item in an unordered list
by default. Text browsers usually use an asterisk for these lists. The following input and
output example shows an unordered list. Figure 5.5 shows the results in a browser.

Input ▼
<p>Things I like to do in the morning:</p>
<ul>
<li>Drink a cup of coffee</li>
<li>Watch the sunrise</li>
<li>Listen to the birds sing</li>
<li>Hear the wind rustling through the trees</li>
<li>Curse the construction noises for spoiling the peaceful mood</li>
</ul >

Output ▼


Customizing Unordered Lists


As with ordered lists, unordered lists can be customized using the type attribute or the
list-style-type property. As mentioned in the section on ordered lists, the type attri-
bute is no longer valid for HTML5. The bullet styles are as follows:

FIGURE 5.5
An unordered list.
Free download pdf