O'Reilly logo

HTML & XHTML: The Definitive Guide, 6th Edition by Bill Kennedy, Chuck Musciano

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Unordered Lists

Like a laundry or shopping list, an unordered list is a collection of related items that have no special order or sequence. The most common unordered list you’ll find on the Web is a collection of hyperlinks to other documents. Some common topic, such as “Related Kumquat Lovers’ Sites,” allies the items in an unordered list, but they have no order among themselves.

The <ul> Tag

The <ul> tag signals to the browser that the following content, between it and the </ul> end tag, is an unordered list of items. Inside, a leading <li> tag identifies each item in the unordered list. Otherwise, nearly anything HTML/XHTML-wise goes, including other lists, text, and multimedia elements.

Typically, the browser adds a leading bullet character and formats each unordered list item on a new line, indented somewhat from the left margin of the document. The actual rendering of unordered lists, although similar for the popular browsers (see Figure 7-1), is not dictated by the standards, so you shouldn’t get bent out of shape trying to attain exact positioning of the elements.

Here is an example XHTML unordered list, as shown in Figure 7-1:

Popular Kumquat recipes: <ul> <li>Pickled Kumquats</li> <li>'Quats ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required