Markdown images
An image is written like a link with an exclamation mark in front of it. The square brackets hold the alt text, not a caption.


<img src="heron.jpg" alt="A blue heron" width="400">
Markdown has no syntax for width or height. GitHub also accepts `` style suffixes for theme switching.
What usually goes wrong
- The text in brackets is alt text for screen readers and for when the image fails to load. It is not a caption and is usually invisible.
- Relative paths are resolved against wherever the file is rendered, which is why images in a README break when the same file is shown somewhere else.
- Markdown cannot centre or float an image. That is HTML and CSS.
- An empty alt (
) is correct for a purely decorative image and wrong for anything carrying meaning.