Images

Anonymous contributor's avatar
Anonymous contributor
Published Aug 6, 2021Updated Dec 10, 2024
Contribute to Docs

Embedding an image is very similar to adding a link in Markdown:

![Alt text](URL or file path)
  • Add an exclamation mark !
  • Followed by the alt text in square brackets [Alt text]
  • And the path or URL to the image asset in parentheses ( ).

For example:

![Sonny and Mariel high fiving.](https://content.codecademy.com/courses/learn-cpp/community-challenge/highfive.gif)

The output would be:

Sonny and Mariel high fiving.

An optional title can also be added after the URL, still in the parentheses:

![Sonny and Mariel high fiving.](https://content.codecademy.com/courses/learn-cpp/community-challenge/highfive.gif 'High Five')

Linked Images

To add a link to an image, enclose the Markdown for the image in brackets, and then add the link in parentheses.

[![A mushroom-head robot drinking bubble tea](/assets/images/codey.jpg 'Codey the Codecademy mascot drinking bubble tea')](https://codecademy.com)

The above example results in the following linked image:

A mushroom-head robot drinking bubble tea

All contributors

Contribute to Docs

Learn Markdown on Codecademy