Lesson 6
Unordered, Ordered and Definition Lists
Unordered List:
Unordered Lists <ul>, <li>,
</ul> will create a bulleted list. The tag can also include the
attributes <ul type=disc|circle|square> (disc being the default),
depending on what type of bullet you want. The end tag </ul> for the list
is only required at the end of the list itself, not at the end of each
individual item. To nest one list within another list, just place the
<ul>, <li>, </ul> within the main list.
This is what the code would look
like:
<ul>
<li> ordered list
<li> unordered list
<ul>
<li> uses
bullets
<li> can be
nested
</ul>
<li> definition list
This is what it would look like in the
browser:
- ordered list
- unordered list
- uses bullets
- can be nested
Ordered List:
Ordered List <ol>, <li>,
</ol> will create an alphabetical or numerical list (numerical is the
default).
The tag can also include the attributes
<ol type=1 | A | a | I | i>, which specifies numbers, uppercase letters,
lowercase letters, uppercase roman numerals and lowercase roman numerals,
respectively. You can also start the list at any number you choose by using the
<start=n> attribute, where "n" is the number you wish to start
the list with. Ordered lists can be nested the same way as unordered
lists.
This is what the code would look
like:
<ol type=1 start=5>
<li> ordered list
<ol type=a>
<li> uses letters
<li> uses numbers
</ol>
<li> unordered list
<li> definition list</li>
</ol>
This is how it would look in the
browser:
- ordered list
- uses letters
- uses numbers
- unordered list
- definition list
Definition List:
|