Markdown cheatsheet and Reference: Using Images

Last updated:
Table of Contents

A Markdown version such as github's GFM (github-flavored markdown) is assumed

Center image

To center an image horizontally, use an img tag (you can embed pure HTML into markdown) and wrap with within p p tag:

<p align="center">
  <img src="http://www.example.com/path/to/img.png">
</p>

Use relative image from github repo

Use raw=true and use a relative path in an img tag (you can embed pure HTML into markdown):

<img src="relative/path/to/file.png?raw=true">

Custom image size

By default, images take all horizontal space available

Use an img tag (you can embed pure HTML into markdown) and set height attribute:

<p align="center">
  <img src="http://www.example.com/path/to/img.png" height="150">
</p>

Dialogue & Discussion