|
Writing HTML | About | FAQ | References | Tags | Lessons | previous | next |8e. HyperGraphicsText does not have a monopoly on being "hyper"... expand the versatility of your web pages by having pictures act as hyperlinks (Just try clicking the cube!).
ObjectivesAfter this lesson you will be able to:
LessonNote: If you do not have the working documents from the previous lessons, download a copy now. A HyperLink ButtonFrom the previous lessons, you have (hopefully) become comfortable with creating hypertext, text within your documents that connects a viewer to related information. You can also use inline images (see Lesson 7a) to act in a "hyper" manner. If you recall, in an earlier lesson we linked some text in our Volcano Web page, index.html, to a second page, msh.html, that described Mount St. Helens. Now in the latter page, we want to add a button that when clicked will link a reader back to the main lesson page. The way to do this is to put the HTML tags for inline images within the hypertext portion of the anchor tag: <a href="fileX.html"> <img src="graphic.gif"> Go to Document X</a> In your web page, this HTML code will display an inline image and the text Go to Document X. Both will act as hyperlinks; clicking on either the text or the picture will tell your web browser to go to the HTML file fileX.html. The image alone could be a hyperlink. In the World Wide Web, a "HyperGraphic" generally is surrounded by a colored box matching the color of hypertext on your web page, so you know that it is "active". NOTE: Many browsers now can alter the color of hypertext and some pages have suppressed the display of the outline around HyperGraphic links. Generally, you can identify a hyperlink area on a web page by looking for a change in the cursor as it passes over a "hot" region. The cursor usually changes from an arrow to a hand when it passes over an active link. Now we will create a "hyper" graphic button. First, you need to get a copy of an arrow button from the Lesson 8e Image Studio. You should now have a copy of the image file somewhere on your computer (You should move it to the pictures folder/directory in your workarea). Next, add the HTML to make the button work:
"Postage Stamp" ImagesPreviously, we advised against using large inline images in your web pages because viewers might have to wait a long time for images to download to their computer. One way around this is to create miniature-size copies of the graphic, or "postage stamps" which are displayed as inline graphics. Then, using the same steps as above, you can make the "postage stamp" image act as a hyperlink that links to the full size image. In this way, the large images are downloaded only if the viewer decides to see it. First, you need to get a copy of the two image files from the Lesson 8e Image Studio. (These files should be stored in your pictures folder/directory of your workarea). Next, create the postage stamp link in your main text file:
Check Your WorkCompare your web page with a sample of how this document should appear. If your web page was different from the sample, review the text you entered in the text editor. Some of the more common mistakes are discrepancies between spelling of the file names and the HTML code for the anchor links or not having the image files in the same directory as the HTML files. If you see an icon of a broken picture:
then it usually means the HTML does not match the file listed in the <img> tag or that the image is not in a GIF or JPEG format. ReviewReview topics for this lesson:
Independent PracticeTry to add buttons that link two web pages to each other. In a later lesson we will learn how to avoide the "box" around a hypergraphic.
Coming Next....Use the preformat tag to create a table of text in your Volcano lesson. GO TO.... | Lesson Index | previous: "Named Anchors" | next: "Preformatted Text" |
Writing HTML: Lesson 8e: HyperGraphics |