Share this Page URL
Help

Chapter 5. Advanced Graphics > Images as Hyperlink Anchors - Pg. 143

Advanced Graphics 143 LONGDESC The LONGDESC attribute was added to HTML 4.0 as a way of making image content more accessible to users with nonvisual browsers. You set LONGDESC equal to the URL of a document that can provide a longer description of the image's content than you would otherwise put in an ALT attribute. A speech- or Braille-based browser could then access the URL and furnish a description of the image to the user. Images as Hyperlink Anchors As explained in Chapter 3, "HTML 4.0 Tag Reference," the <A> container tag is used to create hypertext anchors. By clicking the hypertext, you instruct your browser to load the resource at the URL specified in the HREF attribute of the <A> tag. No law says that hyperlink anchors can only be text. You will often find images serving as anchors, as well. By linking images to other Web pages, you create a button-like effect--the user clicks the button and the browser loads a new page, submits a form, or performs some other action. You can even rig a linked image with JavaScript to submit a form: <IMG SRC="..." onClick="document.form_name.submit();"> To use a graphic as a hyperlink anchor, put the <IMG> tag that places the graphic between <A> and </A> tags: <A HREF="button.html"> <IMG SRC="images/button.jpg" ALT="Push button"></A>