2

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?

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

6 Comments

I wrote the following forms but they all did not work. <img alt="Default" scr="Pictures/VerticalScrollFrame_default.png" width="100">, <img alt="Default" scr="tkinterWidgets/Pictures/VerticalScrollFrame_default.png" width="100"> and <img alt="Default" scr="https://github.com/sunbearc22/tkinterWidgets/blob/master/Pictures/VerticalScrollFrame_default.png" width="100">. The failed outcomes can be seen here. Can you advise me what is wrong here? The GFM versions does appear but GFM does not allow size control.
@SunBear "GFM does not allow size control.": yes, that is what my answer is saying.
@SunBear Can you try with ?raw=true at the end of your URLs? Like https://github.com/sunbearc22/tkinterWidgets/blob/master/Pictures/VerticalScrollFrame_default.png?raw=true
I tried ?raw=true at the end of the above 3 links and still have the same error. Strange.
@SunBear In your source code for the generated page, the src attribute of the img element is missing. Just to be sure, try and close those img elements: <img src="..." alt... /> not the file />
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.