Unordered Lists

An unordered list is a list in which items do not have to take place sequentially. You'll be most familiar with the term bulleted list. Bulleted lists can be used to display such items as product lists, featured items, and short but concisely organized content.

An unordered list works exactly the same way that an ordered list does, but it simply uses the <ul>. . .</ul> (unordered list) element instead of the ordered list element (see Example 2-5). This tag allows the browser to display the list items with bullets rather than numbers.

Example 2-5. An unordered list
<p>Site sections include:</p>

<li>CDs and DVDs</li>
<li>Photographic Equipment</li>

I've used the closing list item </li> tag here, which is fine in HTML (where it's not required, but you can use it) and is necessary in XHTML.

Figure 2-5. An unordered list.

The browser has interpreted the <ul>. . .</ul> element properly by displaying bullets for each list item rather than a numeric value. There are options in CSS to change the style of the bullets, such as having square rather than round bullets.

by BrainBellupdated