How to Turn an Image into a Link in HTML? (original) (raw)

Last Updated : 23 Jul, 2025

Turning an image into a clickable link in HTML is a simple process that can enhance user interaction on your website. By wrapping an image inside an anchor tag (), you can make it clickable and redirect users to a different page or website.

**1. Redirecting to a Specific Page

To turn an image into a link in HTML, wrap the <img> tag inside an <a> tag. This makes the image clickable, and it will redirect to a specific page.

**Syntax:

Clickable Image

**Now, let us understand with the help of the example:

HTML `

Click on GeeksforGeeks logo to Redirect into geeksforgeeks.org

Click to visit geeksforgeeks.org

`

**Output

**In this example:

By default, clicking the image link will open the destination URL in the same browser window. If you want to open the link in a new tab, you can use the target="_blank" attribute.

**Now, let us understand with the help of the example:

HTML `

Click on the styled logo to visit GeeksforGeeks

GeeksforGeeks Logo

`

**Output

**In this example:

Best Practices

Conclusion

Turning an image into a link in HTML is a straightforward process that enhances the interactivity of your web pages. By using the tag to wrap an image, you can easily create clickable images that redirect users to other pages, external websites, or content. Additionally, adding styling effects and accessibility features improves the user experience, making your webpage more user-friendly and responsive.