XHTML 5 Reference

go to previous section go to next section


Lists

Lists are used to display related items. There are three types of lists supported by XHTML that are not connected to form element.

Unordered Lists

An unordered list is one where there is no significance to the order in which the list entries appear. Unordered lists have a 'bullet' in front of each list entry. The general format of source code for an unordered list is:

<ul> (<li> </li>) </ul>

where () indicates a repeating group. For example.

Ordered Lists

An ordered list is one where there is significance to the order in which the list entries appear. Ordered lists are numbered (or lettered) to indicate the place within the order of each item. The general format of source code for an ordered list is:

<ol> (<li> </li>) </ol>

where () indicates a repeating group. For example.

  1. Item one
  2. Item two
  3. Item three

In practice both an ordered and an unordered list can use any of the numerical or bullet types in front of each entry in the list. The only difference between <ul> and <ol> is semantics in that one implies that the content is ordered and the other doesn't regardless of how the list is displayed.

Description Lists

A description lists consists of name/value groups. Each group consists of one or more name elements followed by one or more value elements. The general format of source code for a description list is:

<dl> ((<dt> </dt>) (<dd> </dd>)) </dl>

where () indicates a repeating group. For example.

Name one
value one
Name two A
Name two B
value two
Name three
Value three A
Value three B

Note that in XHTML 1.0 this was considered to be a definition list and had more limited uses.

go to previous section go to next section

 

This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow
Donate