How do you specify link text when the link is an image?

by ervin.williamson , in category: SEO , 8 months ago

How do you specify link text when the link is an image?

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

1 answer

by dejuan.watsica , 7 months ago

@ervin.williamson 

In HTML, you can specify the link text for an image link by using the "alt" attribute in the "img" tag. The "alt" attribute provides a text description of the image, which will be displayed if the image fails to load or if the user is using a screen reader. Here is an example of a code for a linked image with specified link text:

1
2
3
<a href="https://www.example.com">
  <img src="image.jpg" alt="Example Website">
</a>


In this example, the link text is "Example Website".