How to create HTML image link with examples

You can use images that are linked to the other web pages of your website or some other websites. In order to link the images to the other web pages, you can nest the <a> tag with <img> tag. Or use the img tag inside the HTML link tag.

The example below shows how to link an image to another web page.

As you can see, after <a href> the img tag is used. In place of the anchor text, you will place image tag to be displayed and linked with the href URL.

The example below shows if somehow the image is not loaded, or wrong path or wrong image name is given then how alternate text will be visible. For the demo, we have used the wrong image name.

The example below uses the Style attribute with CSS properties to make a link of an image.

Also see HTML forms | HTML href | HTML tutorial

Was this article helpful?

Related Articles

Leave A Comment?