Writing HTML | About | FAQ | Alumni | Tags | Index | back | next |

22. More for Images and Lists

Vaporize those annoying boxes around graphic buttons and:
  • fiddle
  • with
  • bullets
  1. plus
  2. change the
  3. number
  4. style
  5. and value
  6. of list items

Objectives

After this lesson you will be able to:

Lesson

Note: If you do not have the working documents from the previous lessons, download a copy now. Also, you may want to first look at the test page to see of your browser supports the tags used in this lesson

No Hypertext Borders on Hyperlinked Images

In lesson 8e we learned how to make a small graphic image act as a hyperlink to some other web page or a larger size copy of a picture. We noticed that the web browser places a bounding box around the graphic, to identify it as being "hyper" like normal hypertext items:

works just like any other hypertext link.

However, the box is sometimes distracting, especially if we have an image that has non-rectangular borders. The user can typically determine if a picture is "hyper" simply by noting a change in the cursor as they move a mouse over the image (it usually changes to a "hand" when it is over an active link).

You can turn "off" the box by adding an attribute to the <img...> tag:

  <a href="bigpict.gif"><img src="lilpict.gif" border=0>
In this example, the inline image lilpict.gif acts as a hyperlink to the bigger image bigpict.gif. The border=0 attribute has no meaning if the <img..> tag is not inside of an <a href=...</a> tag.

We have two places in our Volcano Web lesson where we have hyperlinked inline images- Do you remember where?

The first is in the usa.htm file, where a small image of a seismometer links to a larger sized image. The second is the arrow button on the msh.htm page that leads back to the lesson.

  1. Open both the usa.htm and the msh.htm in your text editor
  2. Locate the place where we have a small image that links to something else.
  3. Modify each <img src=....> tag that is a hyperlink so that it contains a border=0 attribute. For example, in the msh.htm file it should look like:
      <a href="usa.htm"> 
      <img src="../pictures/left.gif" alt="** " border=0> 
      Return to <i>Volcano Web</i></a>
  4. Save and Load the usa.htm and msh.htm files in your web browser.
  5. If the small images have lost their borders but still connect to their intended target when clicked, your job is done.

Bullets for Un-Ordered Lists

In lesson 6 we first created ordered <ul>...</ul> lists. The web browser automatically puts a bullet mark in front of each item- and the bullets change if we create a list inside of a list. With some web browsers, you can specify in your HTML any of three bullet characters by adding an attribute to the <ul> tag:
 <ul type=xxxx>
where xxxx can be: And even more! You can change the type within a list by putting the type attribute in the <li> tag:
HTML How it Looks
<ul type=square>
<li>this is item 1
<li>this is item 2
<li>this is item 3
<li type=circle>
     Hey! how about these bullets?
<li>this is another item
<li>and one more
<li type=disc>
     Hey! how about these bullets?
</ul>
  • this is item 1
  • this is item 2
  • this is item 3
  • Hey! how about these bullets?
  • this is another item
  • and one more
  • Hey! how about these bullets?

Note that the type specified in the <li type=xxxx> tag is used by all succeeding <li> tags until another bullet type is selected.

We will now change the bullet list style used in our Research Projects page (file proj.htm).

  1. Open your proj.htm file in your text editor.
  2. The first list in this file is an Ordered List <ol>...</ol> but we will now change it to an unordered list with circle bullets. Edit your HTML for this first list so that it looks like:
      <ul type=circle>
      <li>Type of volcano
      <li>Geographic location
      <li>Name, distance, and population of nearest major city
      <li>Date of most recent eruption and date of most destructive
          eruption
      <li>Other events associated with the last eruption (earthquakes,
          floods, mudslides, etc)
      </ul>
  3. Save and Load your file in your web browser. Compare your page with this sample of how your list should like at this point.

Styles and Values for Ordered Lists

When we first created an ordered list <ol>...</ol> in lesson 6, we saw how the web browser automatically numbers the items, one for each <li> tag. What is we do not always want to use arabic numerals (1,2,3...)? Well, here is the answers, a type=x attribute for the <ol> and <li> tags inside:

Arabic Capital Letters Small Letters Large Roman Small Roman
<ol type=1> <ol type=A> <ol type=a> <ol type=I> <ol type=i>
  1. I am first!
  2. I am second!
  3. I am third!
  4. I am fourth!
  5. I am fifth!
  1. I am first!
  2. I am second!
  3. I am third!
  4. I am fourth!
  5. I am fifth!
  1. I am first!
  2. I am second!
  3. I am third!
  4. I am fourth!
  5. I am fifth!
  1. I am first!
  2. I am second!
  3. I am third!
  4. I am fourth!
  5. I am fifth!
  1. I am first!
  2. I am second!
  3. I am third!
  4. I am fourth!
  5. I am fifth!

We presented an example of using ordered lists within ordered lists to create outlines- with the type attribute we can have pages with standard format:

  1. Cheese in Pre-Historic time
    1. Africa
      1. Afar Triangle
      2. East Coast
    2. Asia
    3. Europe
      1. France
        1. Cave paintings depicting cheese harvesting
        2. Burial rituals inferred from dried cheese remnants
      2. British Isles
    4. North America
  2. Cheese in the Middle Ages
    1. King Arthur's Longhorn
    2. Sharp Cheddar for the Crusades
  3. Cheese in the Space Age
Another thing we can do with ordered lists is to have them start counting from some other value than 1. to do this, we add the start=y attribute to the <ol> tag. Note that even if we have some other type=x attribute, we still specify the starting value y as "2,3,10,100, etc". Look at some of these examples:
Arabic Capital Letters Small Letters Large Roman Small Roman
<ol type=1
start=11>
<ol type=A
start=11>
<ol type=a
start=11>
<ol type=I
start=11>
<ol type=i
start=11>
  1. I am eleventh!
  2. I am twelfth!
  3. I am thirteenth!
  4. I am fourteenth!
  5. I am fifteenth!
  1. I am eleventh!
  2. I am twelfth!
  3. I am thirteenth!
  4. I am fourteenth!
  5. I am fifteenth!
  1. I am eleventh!
  2. I am twelfth!
  3. I am thirteenth!
  4. I am fourteenth!
  5. I am fifteenth!
  1. I am eleventh!
  2. I am twelfth!
  3. I am thirteenth!
  4. I am fourteenth!
  5. I am fifteenth!
  1. I am eleventh!
  2. I am twelfth!
  3. I am thirteenth!
  4. I am fourteenth!
  5. I am fifteenth!

And finally you can change the numbering sequence within a list by adding a value=z attribute to the <li> tag. Look at this example:
HTML How it Looks
<ol type=A start=5><i>
Important Cheese Laws</i>
<li>Cheese Curing Act of 1905
<li>Milk Content Ruling of 1923
<p>
<li value=12>Cheese Import Tariff of 1942
<li>Cheese Freshness Codes of 1942
<p>
<li value=1>Cheese Values Act of 1789
    Important Cheese Laws
  1. Cheese Curing Act of 1905
  2. Milk Content Ruling of 1923

  3. Cheese Import Tarif of 1942
  4. Cheese Freshness Codes of 1942

  5. Cheese Values Act of 1789

It may not be exactly clear (especially from this silly example!) when you might use these tags- just keep them in your mind as potential tools in your web writing. We will demonstrate again on our Research Projects page (file proj.htm). If you recall, in our lessons on tables we split the unordered list of reference sites into a two columns list. Let's change this to an ordered list and use the type attribute to list them using small letters. Because we have actually two individual lists, see if you can determine why we would use the start attribute as well.

  1. Open your proj.htm file in your text editor.
  2. Look at the table we created under the References section. Change both <ul> and </ul> tags to <ol type=a> and </ol>
  3. Now, we have 5 items in the first list so we want the second list to start numbering at 6. Modify the <ol> tag now to read:
      <ol type=a start=6>
  4. Save and Reload your file in your web browser. Compare your page with this sample of how your list should like at this point. The first column should list items from "a" to "e" and the second column from "f" to "k"

Check Your Work

Compare your web pages with this sample of how it should appear. If your pages are different than the sample or the hypertext links do not work correctly, review the text you entered in the text editor.

Review

Review topics for this lesson:
  1. How do you get rid of the hypertext box that surrounds a graphic that is hyperlinked to another item?
  2. How can you change the bullet markers for an unordered list?
  3. Do you have to use the same bullet markers for an entire list? If not, how do you change the markers mid-list?
  4. How can you create a list that marks items by Roman Numerals?

Independent Practice

Experiment with different bullet markers and numbering styles in the lists of your own web pages. Can you think of some unique ways to use these added features? Can you make a complex outline with "standard" formatting? All of those
<ol>...</ol>
tags gets to be pretty complicated!

Coming Next....

Click n' go hyperlinked sections within a graphic...
GO TO.... | Lesson Index | back: "Tables" | next: "Image Maps" |

Writing HTML Lesson 22: More for Images and Lists
©1995 Maricopa Center for Learning and Instruction (MCLI)
Maricopa County Community College District, Arizona

The Internet Connection at MCLI is Alan Levine --}
Comments to levine@maricopa.edu

URL: http://www.mcli.dist.maricopa.edu/tut/tut22.htm