HTML (XHTML) List Tutorials

(X)HTML supports 3 types of lists: un-ordered lists, ordered lists and definition lists. This tutorial will only cover un-ordered and ordered lists.

The starting <ul> and ending </ul> tags define an un-ordered list and the starging <ol> and </ol> tags define an ordered list. The <li> and closing </li> tags, which are nested within the starting tags, define each list item.

The code below shows you how to create an un-ordered list.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <body> <ul> <li>un-ordered list item</li> <li>un-ordered list item</li> </ul> </body> </html>

The code above creates the un-ordered list below.

  • un-ordered list item
  • un-ordered list item

The code below creates an ordered list.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <body> <ol> <li>ordered list item</li> <li>ordered list item</li> </ol> </body> </html>

The code above creates the ordered list below.

  1. ordered list item
  2. ordered list item

Web Hosting Resources

Free Website Templates