Changing image size in Markdown

cantdutchthis picture cantdutchthis · Feb 3, 2013 · Viewed 778.5k times · Source

I just got started with Markdown. I love it, but there is one thing bugging me: How can I change the size of an image using Markdown?

The documentation only gives the following suggestion for an image:

![drawing](drawing.jpg)

If it is possible I would like the picture to also be centered. I am asking for general Markdown, not just how GitHub does it.

Answer

Tieme picture Tieme · Feb 7, 2013

You could just use some HTML in your Markdown:

<img src="drawing.jpg" alt="drawing" width="200"/>

Or via style attribute (not supported by GitHub)

<img src="drawing.jpg" alt="drawing" style="width:200px;"/>

Or you could use a custom CSS file as described in this answer on Markdown and image alignment

![drawing](drawing.jpg)

CSS in another file:

img[alt=drawing] { width: 200px; }