Markdown: smaller images sizes not supported by GitHub?

。_饼干妹妹 提交于 2020-01-22 13:28:32

问题


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?


回答1:


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



回答2:


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.



来源:https://stackoverflow.com/questions/22485796/markdown-smaller-images-sizes-not-supported-by-github

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!