Share this Page URL

Chapter 6. A Picture Is Worth a Thousand... > Images: Some Semi-Important Backgrou... - Pg. 65

A Picture Is Worth a Thousand Clicks: Working with Images 65 To emphasize the work-in-progress feel, this page includes a small graphic (constru1.gif) that says "Contents Under Construction" and shows a construction worker in action (see Figure 6.1). Note, too, that the page includes a link that gives the reader an easy way to get back to your home page. (In the <A> tag, make sure you change "index.html" to the appropriate name of your home page. Refer to Chapter 5, "Making the Jump to Hyperspace: Adding Links," if you need a refresher course on this link stuff.) Figure 6.1. A web page to use as a substitute for pages you're still slaving away at. Help! The #%@*&! browser won't display my images! After adding your <IMG> tag, you might be dismayed to find that the browser refuses to display the image. Instead, it just shows a little "X" icon where the image should be. Grrrr. Here are some possible solutions to the all too common problem: · If you're viewing your page on your home machine, the HTML file and the image files might be sitting in separate directories on your computer. Try moving your image file into the directory that holds your HTML file. · If you're viewing your page on the web, perhaps you didn't send the image file to your server. · Make sure you have the correct match for uppercase and lowercase letters. If an image is on your server and it's named "image.gif", and your IMG tag refers to "IMAGE.GIF", your image may not show up. In this case, you'd have to edit your IMG tag so that it refers to "image.gif". · If you're using Netscape to view the page, make sure there are no spaces in the image's file- name. Remember, too, that Netscape doesn't understand BMP graphics. · Make sure you're not missing a quotation mark in the <IMG> tag's SRC attribute. Specifying Image Height and Width When surfing websites that contain graphics, have you ever wondered why it sometimes takes quite a while before anything appears on the screen? Well, one of the biggest delays is that most browsers won't display the entire page until they've calculated the height and width of all the images. The ever-intrepid browser programmers realized this, of course, and decided to do something about it. "What if," they asked themselves, "there was some way to tell the browser the size of each image in advance? That way, the browser wouldn't have to worry about it, and things would show up onscreen much faster." Thus was born two extensions to the <IMG> tag: the HEIGHT and WIDTH attributes: <IMG SRC="filename" WIDTH="x" HEIGHT="y">