Adding Alt Text to Linked Images

  • 1
  • Question
  • Updated 9 years ago
  • Answered
I want to add alt text to linked images. (The images were added to a text widget -so I know that I need to edit the HTML.)

I searched through the forum for info about alt text, and saw the following:
<!--<image src="filename.gif" alt="alternative description goes here">-->

however my HTML code doesn't look like that. It looks more like:
<!--<a href="your link url"><img style="BORDER: 0px;" src="your image path">/a>-->

(your image path says, etc.)

which is code I also found on the forum because I wanted to remove the blue borders that were added to my images when the links were created.

So, can someone advise me where to place the alt code in the link? I know just enough HTML to get into trouble, and not enough HTML to get out of trouble!

Photo of Stephanie


  • 12 Posts
  • 0 Reply Likes

Posted 9 years ago

  • 1
Photo of Connor McCarra

Connor McCarra, Champion

  • 944 Posts
  • 47 Reply Likes
What you want is something like this:

<a href="your link url"><img style="BORDER: 0px;" src="resources/YourImage.jpg" alt="alternative description goes here"></a>

Above, you also didn't close a tag, eg. '...path">/a>' should be '...path"></a>'

Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
Thanks Connor!

Great job on spotting that improperly closed tag as well. =)
Photo of Stephanie


  • 12 Posts
  • 0 Reply Likes
Thanks, I will give that code a try - sorry about the error, I'm glad you pointed that out. That's what I get for trying to type it out from memory! lol!