HTML Image Links

HTML Image Links

HTML Image Link

We have seen how to create hypertext link using text and we also learnt how to use images in our webpages. Now, we will learn how to use images to create hyperlinks.

Example

It's simple to use an image as hyperlink. We just need to use an image inside hyperlink at the place of text as shown below −

<!DOCTYPE html>
<html>
   <head>
      <title>Image Hyperlink Example</title>
   </head>
   <body>
      <p>Click following link</p>
      <a href = "https://www.facebook.com" target = "_self"> 
         <img src = "/images/logo.png" alt = "logo" border = "0"/> 
      </a>
   </body>
</html>