In this post, we will learn how to use an image as a link. Sometimes we need to link an image to another web page. This is what we will learn in this post.


How To Use an Image as a Link in HTML ?


Use an Image as a Link

To make an image a link, first we will create a link using the <a> tag. Then we will insert the image using the <img> tag inside this <a> tag. Now if we see the output in the browser, we see that our image is working like a link. So in this way we can easily convert an image into a link.

We can see an example of this in the code given below:

<!DOCTYPE html>
<html>
<head>
<title>How To Use an Image as a Link in HTML ?</title>
</head>
<body>

<a href="example.com">
<img src="example.jpg" alt="Example Image">
</a>

</body>
</html> code-box


Summary

In this post we learn how to use an image as a link in HTML. You try to make it yourself. I hope you make. If you face any problem, then comment and tell us. Keep visiting the blog to read more similar posts. 

Post a Comment

Previous Post Next Post