HTML Tutorial
HTML Background
HTML Colour
HTML Backgrounds
HTML Images
HTML JAVA
HTML Left Margin
HTML Links
HTML List
HTML Server Side
HTML Software
HTML Structure
HTML Tag Index
HTML Tags
HTML Textures
HTML Upload
Back to Main Page
HTML Basics
Making List

Use lists to display numbered steps, bulleted items, or items and their definitions.

This section introduces HTML list tags. These tags let you display items in list form. You can also use the list tags as an "unofficial" workaround to create an indented paragraph or section.

About Lists

Using HTML tags, you can display items as three types of lists:

  • unordered
  • ordered
  • definition.

In an unordered list each item is preceded by a bullet. You can define the type of bullet you want to use.

In an ordered list each item is preceded by either a number or letter.

In a definition list you specify a term and its definition. The term appears bold and the definition is indented.

Each type of list works the same way. You enter a tag that describes the type of list. Then you tag each list item. Finally, you end the list. You can have paragraphs within lists. Paragraphs within a list are indented, but do not have a bullet or number as list items do.

An easy-to-make mistake is to leave off the end list tag. This leaves the list indent turned on and the remainder of your page appears indented.

Lists tags can easily create a messy looking text file of code. Messy code and neat code will produce the same results, but neat code will be much easier to edit and update in the future.

Unordered List (<ul>)

The unordered list displays items in an indented, vertical column. Each item is preceded by a bullet.

A unordered list uses three tags.

  1. The list begins with the <ul> tag.

  2. Each item in the list is marked with the list item tag, <li>.

  3. The list ends with an off unordered list tag, </ul>.
For example, this code:

There are nine planets:<br>
<ul>
<li>Mercury
<li>Venus
<li>Earth
<li>Mars
<li>Jupiter
<li>Saturn
<li>Uranus
<li>Neptune
<li>Pluto
</ul>

displays like this in a web browser:

There are nine planets:
  • Mercury
  • Venus
  • Earth
  • Mars
  • Jupiter
  • Saturn
  • Uranus
  • Neptune
  • Pluto

If you have lists within lists the brower will display a different type of bullet at each level. You can also specify the type of bullet you want to use by adding the type switch. The type switch has three variables: disc, circle, and square.

  • Disc is the default, a solid circle.<ul type=disc>
  • Circle a hollow circle. <ul type=circle>
  • Square is a hollow box. <ul type=square>

Ordered List (<ol>)

The ordered list displays items in an indented, vertical column. Each item is preceded by a number or letter.

An ordered list uses three tags.

  1. The list begins with the <ol> tag.

  2. Each item in the list is marked with the list item tag, <li>.

  3. The list ends with an off ordered list tag, </ol>.

For example, this code:

There are nine planets:<br>
<ol>
<li>Mercury
<li>Venus
<li>Earth
<li>Mars
<li>Jupiter
<li>Saturn
<li>Uranus
<li>Neptune
<li>Pluto
</ol>

displays like this in a web browser:

There are nine planets:
  1. Mercury
  2. Venus
  3. Earth
  4. Mars
  5. Jupiter
  6. Saturn
  7. Uranus
  8. Neptune
  9. Pluto

The ordered list has two switches:

  • The type switch lets you specify whether to use numbers or letters in your ordered list. The default value is arabic numerals.
    1. <ul type=I> produces a numerical list with roman numerals.
    1. <ul type=A> produces a alphabetical list with capital letters.
    1. <ul type=1> produces a numerical list with arabic numerals. This is also the default value.
    1. <ul type=a> produces a alphabetical list with lowercase letters.
    1. <ul type=i> produces a numerical list with small roman numerals.

  • The start switch lets you start the ordered list at a specific number. For example:

    <ol start=15>
    <li>Rose
    <li>Chrome
    <li>Tangerine

    Starts the list with the number 15:

    1. Rose
    2. Chrome
    3. Tangerine

Definition List (<dl>)

The definition list displays items in two parts. The first is a bold definition term. The second is an indented definition description.

A definition list uses four tags.

  1. The list begins with the <dl> tag.

  2. Each definition term in the list is marked with the definition term tag, <dt>.

  3. Each indented definition in the list is marked with a definition tag, <dt>.

  4. The list ends with an off definition list tag, </dl>.

For example, this code:

There are nine planets:<br>
<dl>
<dt>Mercury
<dd>The closest planet to the sun.
<dt>Venus
<dd>The mysterious planet, shrouded in clouds.
<dt>Earth
<dd>Our little blue orb.
<dt>Mars
<dd>The red planet. Was there ever life there?
<dt>Jupiter
<dd>The biggest planet with many moons.
<dt>Saturn
<dd>The planet best-know for its beautful rings.
<dt>Uranus
<dd>Uranus has rings too -- nine of them, but you can't see them from Earth.
<dt>Neptune
<dd>This planet is 17 times bigger than Earth and has a 17 hour day.
<dt>Pluto
<dd>At the end of our solar system, this planet is distant and cold.
</dl>

displays like this in a web browser:

There are nine planets:
Mercury
The closest planet to the sun.
Venus
The mysterious planet, shrouded in clouds.
Earth
Our little blue orb.
Mars
The red planet. Was there ever life there?
Jupiter
The biggest planet with many moons.
Saturn
The planet best-know for its beautful rings.
Uranus
Uranus has rings too -- nine of them, but you can't see them from Earth.
Neptune
This planet is 17 times bigger than Earth and has a 17 hour day.
Pluto
At the end of our solar system, this one is distant and cold.

Using Lists for Indents

There is no indent tag in HTML. However, if you want a quick and easy way to create an indent on the left margin, you can simply use an unordered list tag. Don't use the list item tags -- these will create the bullets. Instead, simply start each line or paragraph with a paragraph or break tag, like this:

<p>Below you will find my address. Please send me the items I've ordered.
<ul>
<p>Happy Smith<br>
1234 Main Street<br>
Melrose, MA<br>
</ul>
<p>Thanks very much!

Which displays in a web browser, like this:

Below you will find my address. Please send me the items I've ordered.

    Happy Smith
    1234 Main Street
    Melrose, MA

Thanks very much!


Tell Me More!

Hypertext is the idea of linking together content across many different locations. The basic strength of the web lies in its ability to display seamless links. The very name "browser" also comes from this idea. The browser lets you graze content from different locations around the world. Once you're comfortable with the basic tags, you're ready to learn how to make links.

Any questions or suggestions, email us at info@hawaiialoha.net
Please be sure to include as much information as possible to help us serve you.

All Rights Reserved, Hawaii Aloha Network © 2001