سؤال

I want to downsize some of my images in my README.md on GitHub and it works fine in my Markdown editor using something like

![](./images/my_img.png =400x)

However, when I upload it to GitHub, the Markdown viewer seems to not like it. Any suggestions or ideas how I can downsize the images without reducing the resolution of the images themselves?

هل كانت مفيدة؟

المحلول

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">

نصائح أخرى

You can use HTML syntax for the image directly in markdown

## Markdown Header

This is a markdown paragraph. Etc.

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

Update: As tzolov notes, GitHub doesn't actually permit inline styles. His technique does work, though.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top