List Tags

 

The next few tags are used for displaying text as lists.

Tags and Meaning

Description

List item

<LI>

This is used to declare an item in a list. See <OL></OL> Description.
Ordered List

<OL></OL>

It might be better to think of this as a numbered list. Correctly formatted in a .html file, it should look as follows, note the <LI> tag for each item in the list:
<OL>
<LI>Item number one.
<LI>Item number two.
<LI>Item number three.
</OL>

The output of this will then look as follows:

  1. Item number one.
  2. Item number two.
  3. Item number three.
Unordered List

<UL></UL>

Again like Ordered List, but instead of numbers it has bullets:
<UL>
<LI>First item.
<LI>Second item.
<LI>Third item.
</UL>

The output of this will look as follows:

  • First item.
  • Second item.
  • Third item.
Definition Term

<DT><DD>

The <DT> tag is used in association with the <DD> tag. The <DT> tag specifies that the text defined with it will act as a heading of sorts to the text that follows the <DD> tag. The <DD> tag will accept a full paragraph of text, continuously indented beneath the <DT> term. Confused yet? Well don't worry, this should become a lot more clear once you've looked at the <DL></DL> tags example and description.
Definition list

<DL></DL>

This is designed to allow two levels of list items, <DT> and <DD>. This is used when you have a list of items with a description for that item, like a dictionary:
<DL>
<DT>Hero
<DD>A person admired for his or her brave deeds.
<DT>Hex
<DD>An evil spell or magical curse.
</DL>

The output of this will look as follows, note how the <DT> tag defines a new line while the text next to the <DD> tag is indented under the <DT> tag's defined text:

Hero
A person admired for his or her brave deeds.
Hex
An evil spell or magical curse.

 

All of the above list tags can be nested within each other. Look at the following example of lists.

<HTML>
<HEAD>
<TITLE>List Tag Examples</TITLE>
</HEAD>
<BODY>
The following is an example of nesting the different list tags:
<OL>
<LI>Introduction
<LI>Chapter One
<UL>
<LI>Section 1.1
<LI>Section 1.2
<LI>Section 1.3
</UL>
<LI>Chapter Two
</OL>
Computer Terms
<DL>
<DT>CPU
<DD>Central Processing Unit. This is the "brain" of a computer, where instructions created by the computer system software and application software are carried out.
<DT>Hard Drive
<DD>Sometimes called fixed drive, this is a device (generally mounted inside a computers' case) with spinning magnetic plates that is designed to store computer data. When a file is "saved" to the hard drive, it is available for accessing at a later time.
</DL>
</BODY>
</HTML>
screen.gif (1270 bytes) Click here to see what the output of the above code would look like. To come back to this page when you've finished looking at the result, close the new window it opened in.
output.gif (894 bytes) Click here to go to the personal homepage example, for this section of the tutorial. 

 

[Next Section - Adding Graphics] [Back To Index Page]

Introduction | Basic Tags | More HTML Tags | List Tags | Adding Graphics | Creating Links | Adding Forms | Adding Tables
Creating Frames | Multimedia | Uploading Files | Downloads | Questions & Answers | Useful Links | e-mail Me
 
Example Page 1 | Example Page 2 | Example Page 3 | Example Page 4 | Example Page 5 | Example Page 6
Example Page 7 | Example Page 8 | Example Page 9 | Example Page 10
 
Color Chart | HTML Tester
bar.gif (1848 bytes)
Copyright © 1999 - 2000 Green Tentacle. All rights reserved. This tutorial is protected by SA and international copyright laws.
Hosted by www.Geocities.ws

1