Javatpoint Logo
Javatpoint Logo

How to make an Image a Link in Html

If we want to make the image as a link for linking another Html page then we have to follow the steps which are given below. Using these steps, we can easily make any image as a link:

Step 1: Firstly, we have to type the Html code in any text editor or open the existing Html file in the text editor in which we want to make an image as a link.

Step 2: Now, place the cursor just before the <img> tag in Html document. And, then we have to use the anchor tag which is used for linking another page. So, type the <a> tag at that point.

Step 3: Now, we have to add the attribute of anchor tag whose name is "href". So, type the href attribute within the starting <a> tag. And, then we have to give the path of that html page which we want to link with image. So, type the path in the href attribute as described in the following block or Html code.

Step 4: And, at last we have to save the Html file and then run the file in the browser.

Test it Now

The output of the above Html code is shown in the following screenshot:

How to make an Image a Link in Html




Youtube For Videos Join Our Youtube Channel: Join Now

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA