Publishers of technology books, eBooks, and videos for creative people

Home > Articles

This chapter is from the book

Lists

After paragraphs and headings, the next most common element you’ll find in text is a list. If you look back at a Word or Google Doc you’ve done recently, you’ll likely find bulleted lists show up at least a few times.

There are two different types of lists you can create in HTML: ordered and unordered.

Ordered lists (by default) are prefixed by numbers. Unordered lists have bullets (bullt-disc.jpg) prefixed.

Depending on the type of list you want to create, use an <ol> tag (for an ordered list) or a <ul> tag (for an unordered list). Between the opening and closing tags, each item on the list will be enclosed in <li> tags (for list item).

To create an unordered list:

  1. In your HTML file, type <ul> to begin the list.

  2. Type <li>Apples</li> to create the first of three items on the list.

  3. Type <li>Bananas</li>.

  4. Type <li>Cherries</li>.

  5. Type </ul> to end the list.

    And in FIGURE 4.3, you see how it looks.

FIGURE 4.3

FIGURE 4.3 The unordered list you created, as rendered in the browser

Peachpit Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from Peachpit and its family of brands. I can unsubscribe at any time.