Lists
There are two basic lists in HTML, the ordered or numbered list and the
unordered or bulletted list. Each list has two tags associated with it, the
list type tag and the list elements tag.
Ordered Lists
Use the OL tag (the ending /OL tag is required), and create a list of numbers
starting with 1. The elements are created with the LI tag (the ending /LI tag
is not required). For example:
- Entry 1
- Entry 2
The code:
<ol>
<li>Entry 1
<li>Entry 2
</ol>
Unordered Lists
Use the UL tag (the ending /UL tag is required), and create a list with bullets
instead of numbers. The elements are also created with the LI tag. For example:
The code:
<ul>
<li>Entry 1
<li>Entry 2
</ul>
Definition Lists
Definition lists allow you to indent text underneath words in the fashion of a
dictionary entry. There are three tags associated with the definition list, the
list type tag <DL>, the definition term tag <DT>, and the definition tag <DD>.
The ending tag is only required for the <DL> tag, but it is a good idea to
include it for all of them. Here is how a definition list looks:
- This is a definition term
- And this is the definition
The code:
<dl>
<dt>This is a definition term</dt>
<dd>And this is the definition</dd>
</dl>p
|