.

Sunday, March 28, 2010

List elements

Posted by devlevis | Sunday, March 28, 2010 | Category: , , , , |

HTML specifies three different types of lists:
✦ Ordered lists (usually numbered)
✦ Unordered lists (usually bulleted)
✦ Definition lists (list items with integrated definitions)
The ordered and unordered lists both use a list item element (<li>) for each of the
items in the list. The definition list has two tags, one for list items (<dt>) and
another for the definition of the item (<dd>).

The following HTML code results in the output shown in Figure .

<html>
<body>
<ol>A basic ordered list
<li>First ordered item
<li>Second ordered item
<li>Third ordered item
</ol>
<ul>Unordered list
<li>First unordered item
<li>Second unordered item
<li>Third unordered item
</ul>
<dl>Definition list
<dt>First definition item
<dd>First definition
<dt>Second definition item
<dd>Second definition
<dt>Third definition item
<dd>Third definition
</dl>
</body>
</html>

output is shown in figure














Because of the amount of customization allowed for each type of list, you can create
many substyles of each type of list. For example, you can specify that an ordered list
be ordered by letters instead of numbers.
The following HTML code does just that, resulting in the output shown in Figure .

<html>
<body>
<ol style-"list-style:lower-alpha;">A basic ordered list (lower-case alpha)
<li>First ordered item
<li>Second ordered item
<li>Third ordered item
</ol>
</body>
</html>

Currently have 0 comments:


Leave a Reply