Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

html

How to change image size in Markdown

abhilash

Overview

There are a lot of Markdown flavors, but the most popular one is the Github Flavor Markdown (GFM). Unfortunately, there is no support for resizing an image using the Markdown syntax.

Raw HTML needs to be used to change the image size in Markdown.

To do this, we can follow the steps below.

  1. Upload the image to a server to get an URL.
  2. Use the <img> tag. Set the src attribute to the URL obtained.
  3. Set the width and height attributes.

The width and height attributes can be absolute values, or they can be percentages.

Example

We can set the width and height using absolute values, as follows:

<img src="https://mma.prnewswire.com/media/1513369/Educative_Logo.jpg"  width="600" height="300">

The output of the HTML code above is as follows:

We can also set the width and height using percentages, as follows:

<img src="https://mma.prnewswire.com/media/1513369/Educative_Logo.jpg"  width="60%" height="30%">

The output of the HTML code above is as follows:

RELATED TAGS

html
RELATED COURSES

View all Courses

Keep Exploring