Sun Bear
Sun Bear

Reputation: 8295

How to control the size of a displayed image in a github repository?

Github uses markdown language to add an image.

  1. Create a directory in the repository (e.g. Image/) to store the image file.
  2. Refer to that image by using markdown language ![MyPicText](/Image/MyPicName.png)

This Youtube video shows that html language, i.e. <img scr="/Image/MyPicName.png" width="100">, may be used to display and control of the size of the selected image.

I have tried it but the image did not even appear. Also I did not get any error message. Instead, I discovered that an invisible hyperlink exist in its place.

How should I control the size of a displayed image in a github repository?

Upvotes: 2

Views: 1942

Answers (1)

VonC
VonC

Reputation: 1326366

As commented in this example:

Github doesn't apply the style attribute but obeys the width and height.
So for GitHub, you can use the following HTML tag directly in the markdown:

<img src="url" alt="alt text" width="whatever" height="whatever">

See also GFM Image: nothing about size.

The OP confirms it works:

It is suppose to be src and not scr which I wrote.

Upvotes: 3

Related Questions