Search code examples
githubreadme

How to add image banner in github?


I want to add an image banner that would be displayed when searching through the Github topics (since the repo stands out).

I want to do something like thisenter image description here

currently, I'm adding the image at the top of the readme.md file but it does not work.

<h1 align="center">
 <img src="image-url-here" />
</h1>

# rest of readme ..

How should I do this?


Solution

  • That is the "Social Preview" under your repository settings.


    README.md is written in Markdown. It is then translated into HTML. The md is for "Markdown".

    Your HTML would be written like so:

    # [description of the image](image-url-here)
    

    # indicates a first tier header and ![description of the image](image-url-here) is a link to an image with the alt of "description of the image".

    More help can be found in Writing On GitHub.