Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 155 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

Possible Duplicate:
recommended syntax for an image with a link

How can I create an image link using the Markdown format? I want an output like <a href="" rel="some text"><img src="/path/to/file" alt="" /></a>. I can't seem to find the answer in http://stackoverflow.com/editing-help.

share|improve this question

migrated from stackoverflow.com Feb 10 '10 at 13:24

This question came from our site for professional and enthusiast programmers.

marked as duplicate by random, alex, jjnguy, perbert, ChrisF Feb 11 '10 at 8:58

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2  
![](/path/to/file) – KennyTM Feb 9 '10 at 15:58
    
    
May be this should be added to the FAQ and/or the editing help? – perbert Feb 10 '10 at 17:20

There does not appear to be a single markdown construct that will do what you want, however both of the following pieces of markdown work (as least on SO):

[<img src="http://www.google.com.au/images/nav_logo7.png">](http://google.com.au/)

[![Foo](http://www.google.com.au/images/nav_logo7.png)](http://google.com.au/)

I agree it would be a handy thing to have (along with markdown markup for width, height, floating left or right and adding a caption).

EDIT: I don't think there is any markdown available for the rel attribute of links.

<a href="http://google.com.au/" rel="some text">![Foo](http://www.google.com.au/images/nav_logo7.png)]</a>

The above looks like your best case, although by this stage you almost might as well just use HTML for the image as well and be done with it.

share|improve this answer
    
At least in MarkDown Extra the following, more readable approach, will also work: ### [SmartyPants][] and other goodies [![SmartyPantsImg][]][SmartyPants] [SmartyPants]: daringfireball.net/projects/smartypants` [SmartyPantsImg]: daringfireball.net/graphics/smartypants_title.gif` – Thomas G. Dec 28 '13 at 8:02