Vaporize those annoying boxes around graphic buttons,
or add extra borders plus:
|
|
After this lesson you will be able to:
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.
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 hide 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 web site where we have hyperlinked inline images -- do you remember where?
The first is in the usa.html file, where a small image of a seismometer links to a larger sized image. The second is the arrow button on the msh.html page that leads back to the lesson.
<a href="usa.html"> <img src="../pictures/left.gif" alt="** " border=0> Return to <i>Volcano Web</i></a>
And now we show you how to do the opposite of taking away borders; adding BIG THICK borders! You can use the same border=X option to add a border around an image. The number you use for X determines the thickness, in pixels, of the border placed around an image:
8 pixel border on an inline image
<IMG SRC="pictures/disk.gif" WIDTH=48 HEIGHT=40 border=8>Note that the border color is the color defined as the TEXT color in the BODY tag. (see lesson 16)
You can also use this on an image that is acting as a hyperlink:
8 pixel border on an inline image, hyperlinked to another page
<A HREF="page.html"> <IMG SRC="pictures/disk.gif" WIDTH=48 HEIGHT=40 border=8></a>Note that the border color is the color defined as the LINK color in the BODY tag. (see lesson 16)
In lesson 6 we first created unordered <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 here is 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 circle bullets? <li type=circle>this is another item <li type=circle>and one more <li type=disc> Hey! how about this disc bullet? </ul> |
|
In NetScape browsers, the type specified in the <li type=xxxx> tag is used by all succeeding <li> tags that do not have a type attribute until another bullet type is established. However, in Internet Explorer web browsers, list items without a type attribute will revert to the type set in the intitial <ul> tag. Therefore, our recommendation is that if you wish to change the bullet styles wihtin a list is that you set it for each <li> tag that requires a different bullet.
Differences between the web browsers sure make life complicated! And this is another reason you should consider checking your site in more environments that just your own computer.
We will now change the bullet list style used in our Research Projects page (file proj.html).
<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>
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 if we do not always want to use arabic numerals (1,2,3...)? Well, here are 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> |
|
|
|
|
|
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:
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> |
|
|
|
|
|
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 |
|
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.html). If you recall, in our lessons on tables we split the unordered list of reference sites into a two column 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.
<ol type=a start=7>
Compare your web pages with this sample of how it should appear. If your pages are different from the sample or the hypertext links do not work correctly, review the text you entered in the text editor.
Review topics for this lesson:
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!
Map your way from an image... Click n' go hyperlinked sections within a graphic...
Writing HTML: Lesson 22: More for Images and Lists
©1994-1999
Maricopa Center for Learning and Instruction (MCLI)
Maricopa Community Colleges
The 'net connection at MCLI is
Alan Levine
Comments to alan.levine@domail.maricopa.edu
URL: http://www.mcli.dist.maricopa.edu/tut/tut22.html