Skip to content

HTML image link | Use an image as a link in HTML

  • by

How to make a picture into a link HTML?

Simply Use the “img tag” as well as the “a tag” with the href attribute to create an HTML image link. Under the image tag src attribute, add the URL of the image.

  • img Tag :- for using an image in a web page
  • <a> Tag :- is for adding a link

Example of HTML image link

Here is simple example code of Image as a Link.

<!DOCTYPE html> 
<html> 
<head>
    
</head>
<body> 
    
      <a href="https://www.eyehunts.com/">
         <img alt="Qries" src="fevicon.png">
      </a>

</body> 
</html> 

Output:

Example of HTML image link

Q: How to Make an image a clickable link in HTML?

Answer: Here is one of the standard approaches to make image clickable.

<!DOCTYPE html>
<html>
<body>

<span>Open image link in a new tab: 
 <a href="http://www.google.com" target="_blank" rel="noopener noreferrer">
  <img src="path/images.jpg" />
 </a>
</span>

</body>
</html>

Do comment if you have any question and suggestion on this tutorial.

Note: The All HTML Examples codes are tested on the Firefox browser and the Chrome browser.

OS: Windows 10

Code: HTML 5 Version

Leave a Reply

Discover more from Tutorial

Subscribe now to keep reading and get access to the full archive.

Continue reading