Skip to Main Content or Page Contents
Unordered Lists <ul>
Change Default Unordered Lists from a disc to a square.
Unordered List Used as a Menu Example 4.
HTML Lists Introduction
Ordered Lists <ol>
Description Lists <dl>
The <ul> tag works in conjunction with the line <li> tag
<ul>
<li>one</li> <li>two</li> <li>three</li> <li>etc.</li> </ul>
<ul> The ul element is the container for the entire
<li> The li element is used for each line of the list
By default Unordered Lists
See the result of the above Simple Unordered List
<ul> <li>List Item 1</li> <li>List Item 2 <!-- closing </li> is moved below --> <ul> <li>double nested List Item 2b</li> </ul> </li> <!-- for nested List Item 2a --> </ul> </li> <li>List Item 3</li> </ul><ul> <li>nested List Item 2a
See the result of the above Nested Unordered List
The nested portion constisting of:
a <ul>opening tag
One or more <li> tags and contents </li>
</ul>closing tag
is inserted inside the <li> & </li> tags therefore the closing </li> is placed after the nested portion
Nested Unordered Lists are slightly tricky to do. Double Nested Lists even trickier.
The nested portion(s) of the list are indented
A nested list with it's own start <ul> & end ul </ul> along with it's list of <li>(s)s
E.g.
<ul>
<li>double nested List Item 2b</li>
</ul>
is placed immediatly before the closing </li>
Many of the editors will do the nesting for you see the editors instructions
<ul style="list-style-type:square;"> <li>one</li> <li> two </li> <li>three</li> <li>etc.</li> </ul>
<ul> <li>one <ul> <li>two <ul> <li>three</li> </ul> </li> <!-- Closing li tag for two --> </ul> </li> <!-- Closing li tag for one --> <li>etc.</li> </ul>
Double check the location of the closing </li> tags
Indenting the code helps. The opening & closing tags should line up vertically
Example 4. Result
In our Tutorial 11 Menus