24

How to add an image that is also a link to an external page on Github's README.md?

Adding a markdown to display an image is pretty simple (answer at Add images to README.md on GitHub). Adding a link is also pretty simple (GitHub relative link in Markdown file), but it seems there's is no way to add an image that is also a link to an external site.

<a href="https://stackoverflow.com/"><img src="RELATIVE_PATH_TO_IMAGE></img></a>
Rafael Borja
  • 3,937
  • 6
  • 23
  • 32

2 Answers2

43

Try simply the syntax:

[![name](link to image on GH)](link to your URL)

That will wrap the image as a link

René K
  • 193
  • 3
  • 14
VonC
  • 1,129,465
  • 480
  • 4,036
  • 4,755
4

Some additional syntax mixing html and markdown, giving you more flexibility in adjusting how image is displayed.

Assuming you have repo structure as follows (it just refers to relative link used in syntax below):

example repo structure

you can use

[<img alt="alt_text" width="40px" src="images/image.PNG" />](https://www.google.com/)
heniczyna
  • 41
  • 2