Skip to main content
7 of 8
replaced http://meta.stackoverflow.com/ with https://meta.stackoverflow.com/

What's the recommended syntax for an image with a link?

What's the recommended syntax for an image with a hyperlink? I tried doing it with the markdown toolbar buttons and the image and link buttons conflict with each other, so I had to resort to HTML.

For example, to do this:

alt text

These work properly:

<a href="https://meta.stackoverflow.com/users/44330/jason-s">![alt text][1]</a> [1]: https://www.gravatar.com/avatar/dd5a7ef1476fb01998a215b1642dfd07?s=128&d=identicon&r=PG <a href="https://meta.stackoverflow.com/users/44330/jason-s"> <img src="https://www.gravatar.com/avatar/dd5a7ef1476fb01998a215b1642dfd07?s=128&d=identicon&r=PG"> </a> [<img src="https://www.gravatar.com/avatar/dd5a7ef1476fb01998a215b1642dfd07?s=128&d=identicon&r=PG">][2] [2]: https://meta.stackoverflow.com/users/44330/jason-s 

This does not:

<a href='https://meta.stackoverflow.com/users/44330/jason-s'>![alt text][1]</a> 

(single quotes not allowed?)

Is there a way to do the same thing in Markdown without having to resort to HTML?

Return to FAQ index

Jason S
  • 6.4k
  • 2
  • 33
  • 38