|Ever wonder how people can make images like the one at the right active as links? (If you click the image, you'll go to the home page of the World Wide Web Consortium.)|
Actually, it's trivial. Anything between an opening
tag and closing
</a> tag becomes active.
Just put your
<img> tag between the
</a>, and it will become active
too. Here's the code for the image above:
<a href="http://www.w3.org"><img src="w3c_home.gif" alt="World Wide Web Consortium Home" width="72" height="46" border="0" /></a>
There are two “gotchas” associated with making an image
clickable. If you look at the
Take a close look at the clickable image at the right. You might, in an older browser, see a blue underscore at the lower right corner of the image.
This annoying little artifact occurs when people make files more readable by putting opening and closing tags on different lines, as shown below. The “new line” characters, which are normally invisble, are shown in red.
Ordinarily, making files readable is a Good Thing. However, in this case,
it backfires. HTML takes any run of blanks, TABs, or new lines and
translates them into a single blank. The new lines inside the
This, then, is one place where we have to make readability take a back seat
to good looks. Just put the closing
|<< Common Mistakes||Index||Links Among Pages >>|