Sams Teach Yourself HTML 4 in 24 Hours

Sams Teach Yourself HTML 4 in 24 Hours

By Dick Oliver

Images That Are Links

You can make any image into a clickable link to another page with the same <a href> tag used to make text links. Figures 10.1 and 10.2 show an example; clicking the big button at the bottom of the page (or the words Click here for more bargains!) retrieves the page named zolzol.htm.

Normally, Web browsers draw a colored rectangle around the edge of each image link. Like text links, the rectangle usually appears blue to people who haven't visited the link recently, and purple to people who have. Since you seldom, if ever, want this unsightly line around your beautiful buttons, you should always include border="0" in any <img /> tag within a link. (You learn more about the border attribute in Hour 13, "Page Design and Layout." )

Hour 11, "Custom Backgrounds and Colors," explains how to change the link colors. All the same rules and possibilities discussed in Hour 3, and Hour 7, "Email Links and Links Within a Page," apply to image links exactly as they do for text links. (You can link to another part of the same page with <a href="#name"> and <a name="name"> , for example.)

Share ThisShare This

Informit Network