Wednesday, July 05, 2006

Ordered List

Translations

If we want to list a few items on the page, and the ordering of the items is important, we can use tag „<ol>“ to surround the whole list, and the tag „<li>“ to surround individual items. For example:

<p>Seasons:</p>
<ol>
<li>Spring</li>
<li>Summer</li>
<li>Autumn</li>
<li>Winter</li>
</ol>

Seasons:

  1. Spring
  2. Summer
  3. Autumn
  4. Winter

By default the items are marked by numbers, starting from 1. But we can choose a few other numbering systems: armenian, cjk-ideographic, georgian, lower-greek, hebrew, hiragana, hiragana-iroha, katakana, katakana-iroha, lower-latin, upper-latin, lower-roman, upper-roman.

The season list marked with uppercase Roman numbers will look like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Seasons</title>
<style type="text/css">
ol.seasons {
 list-style-type: upper-roman;
}
</style>
</head>
<body>

<p>Seasons:</p>
<ol class="seasons">
<li>Spring</li>
<li>Summer</li>
<li>Autumn</li>
<li>Winter</li>
</ol>

</body>
</html>

Seasons:

  1. Spring
  2. Summer
  3. Autumn
  4. Winter

0 Comments:

Post a Comment

<< Home