MarkdownPaper Open reader

Guide

How to add an image in Markdown

To add an image in Markdown, write an exclamation mark, the image description in square brackets, and the image's address in round brackets: ![Description](image.png). It is the same as a link with ! in front.

You write

![MarkdownPaper logo](/icon-192.png)

You see

MarkdownPaper logo

The words in square brackets are the alt text. Screen readers read them aloud, and they show if the image cannot load, so describe what the image shows.

On this page

Use an image from your project

Point to the file with a path. A path that does not start with / or http starts from the folder your Markdown file is in.

You write

![Screenshot of the settings page](images/settings.png)

You see

Screenshot of the settings page

That works on GitHub and in apps that open the whole folder. The example above shows no picture here because this page has no images folder, which is exactly what happens when a path is wrong.

Use an image from the web

Give the full address, starting with https://.

You write

![MarkdownPaper logo](https://markdownpaper.app/icon-192.png)

You see

MarkdownPaper logo

Change the image size

Markdown has no way to set a size. Use an HTML img tag with a width instead. Most renderers, GitHub and MarkdownPaper included, allow it.

You write

<img src="/icon-192.png" alt="MarkdownPaper logo" width="64">

You see

MarkdownPaper logo

Give only the width, and the height follows, so the image keeps its shape.

Center an image

Wrap the image in a paragraph with align="center". This is old HTML, but it is the way that works on GitHub, where styles are removed.

You write

<p align="center">
  <img src="/icon-192.png" alt="MarkdownPaper logo" width="80">
</p>

You see

MarkdownPaper logo

Add a caption

Markdown has no caption either. The simplest way is a line of italic text under the image. In HTML, a figure with a figcaption is the proper way.

You write

<figure>
  <img src="/icon-192.png" alt="MarkdownPaper logo" width="80">
  <figcaption>The MarkdownPaper mark.</figcaption>
</figure>

You see

MarkdownPaper logo
The MarkdownPaper mark.

Put the whole image inside a link's square brackets.

You write

[![MarkdownPaper logo](/icon-192.png)](https://markdownpaper.app)

You see

MarkdownPaper logo

Show a title on hover

Add text in quotes after the address.

You write

![MarkdownPaper logo](/icon-192.png "The reader for Markdown")

You see

MarkdownPaper logo

Images side by side

Put the images on the same line, with no empty line between them.

You write

<img src="/icon-192.png" alt="Logo" width="48"> <img src="/icon-192.png" alt="Logo again" width="48">

You see

Logo Logo again

Why an image does not show

  • The path is wrong. Check the folder and the file name, including capital letters. Logo.png and logo.png are different files on most servers.
  • There is a space in the file name. Write it as %20, or rename the file.
  • The ! is missing. Without it you get a link, not an image.
  • The app cannot see the file. A web page cannot read pictures from your computer. A README with relative images shows them on GitHub, and the MarkdownPaper desktop app shows them when you open the folder.

Questions

Can I add an image from my computer to Markdown?

Yes. Put the image in the same folder as the Markdown file, or a folder inside it, and use a relative path like images/photo.png. Keep the two together when you move or share them.

What image formats work in Markdown?

Whatever the browser or app can show: PNG, JPG, GIF, WebP and SVG all work almost everywhere.

How do I resize an image in Markdown on GitHub?

Use an HTML img tag with a width, like <img src="image.png" alt="Description" width="300">. GitHub keeps the width and removes any style attribute.

What is alt text in Markdown?

The words in the square brackets. They describe the image for people who cannot see it and appear when the image fails to load.

Next