HTML and CSS Reference
In-Depth Information
Removing Image Borders
By default, Web browsers underline hypertext links. If an image is linked, browsers
usually display the image with a colored border. To remove the border, you can add the
following style attribute to the img element:
<img src=”fi fi le ” alt=” text ” style=”border-width: 0px” />
This attribute sets the width of the border to 0 pixels, effectively removing it from the
rendered Web page. You can also set the border width to 0 by using the following bor-
der attribute:
<img src=”fi fi le ” alt=” text ” border=”0” />
Note that the border attribute is not supported in HTML5 but you will still see it used in
many Web sites. Despite the fact that many browsers still support the use of the border
attribute, you should not use it, relying instead on either the style attribute or styles set
within an external style sheet.
Introducing Image Maps
When you mark an inline image as a hyperlink, the entire image is linked to the same
destination fi le. However, HTML also allows you to divide an image into different zones,
or hotspots, each linked to a different destination. Gerry is interested in doing this with
the current image in the CAMshots header. He would like you to create hotspots for the
logo so that if a user clicks anywhere within the CAMshots circle on the left side of the
logo, the user jumps to the Home page; and if the user clicks either Tips or Photo Glossary
in the logo, the user jumps to the Tips page or to the Glossary page, respectively. See
Figure 2-30.
Figure 2-30
Hotspots within the CAMshots header image
home.htm
glossary.htm
tips.htm
 
Search WWH ::




Custom Search