Linking the Image
Many times you will want to link an image to either another HTML document or a detailed version of the image. In either case, linking an image works the same way as linking text. You surround the image code with the anchor element and the reference to where the image is linking, just as if it were the text content (see Example 3-3).
Example 3-3. Linking the image
<a href="detail.html"><img src="images/photo.jpg" width="250" height="188" alt="photograph of a delicious Vietnamese noodle dish from restaurant Pho 88" /></a>
The image is now linked, and when clicked on, it will take the visitor to the detail.html page. You can even add a title attribute to the link if you want further details about the link to be available ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access