文章首发及后续更新:https://mwhls.top/2657.html
新的更新内容请到mwhls.top查看。
无图/无目录/格式错误/更多相关请到上方的文章首发页面查看。
如有翻译问题欢迎评论指出,谢谢。
改变Markdown图片的大小的方式
- cantdutchthis asked:
- 我刚开始用markdown,感觉不错,不过有个小问题困扰着我:怎样改变markdown图片的大小?
- 文档只给出了下面的图片使用例子
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-SkiBFLar-1624693150471)(drawing.jpg)]
- 以及有没有办法能让图片居中?希望是用标准markdown语法实现的,而不是GitHub实现的。
- Answers:
- Tieme – vote: 1254
- 在markdown里面使用html标签:
<img src=“drawing.jpg” alt=“drawing” width=“200”/>
- 或者使用
style
属性(GitHub不支持) <img src=“drawing.jpg” alt=“drawing” style=“width:200px;”/>
- 或者自定义CSS文件像这篇回答里说的:Markdown and image alignment
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-jNmDhZX1-1624693150474)(drawing.jpg)]
- 在其它文件的CSS:
img[alt=drawing] { width: 200px; }
- prosseek – vote: 662
- kushdilip – vote: 405
- The accepted answer here isn’t working with any Markdown editor available in the apps I have used till date like Ghost, Stackedit.io or even in the StackOverflow editor. I found a workaround here in the StackEdit.io issue tracker.
- 这段看不懂,机翻也看不懂,不过下面这句我看懂了,所以问题不大。
- 直接使用HTML语法就好了,非常完美:
<img src=“http://…jpg” width=“200” height=“200” />
- The accepted answer here isn’t working with any Markdown editor available in the apps I have used till date like Ghost, Stackedit.io or even in the StackOverflow editor. I found a workaround here in the StackEdit.io issue tracker.
- Tieme – vote: 1254
Changing image size in Markdown
- cantdutchthis asked:
- I just got started with Markdown. I love it, but there is one thing bugging me: How can I change the size of an image using Markdown?
- 我刚开始用markdown,感觉不错,不过有个小问题困扰着我:怎样改变markdown图片的大小?
- The documentation only gives the following suggestion for an image:
- 文档只给出了下面的图片使用例子
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-sG5mTiRn-1624693150485)(drawing.jpg)]
- If it is possible I would like the picture to also be centered. I am asking for general Markdown, not just how GitHub does it.
- 以及有没有办法能让图片居中?希望是用标准markdown语法实现的,而不是GitHub实现的。
- I just got started with Markdown. I love it, but there is one thing bugging me: How can I change the size of an image using Markdown?
- Answers:
- Tieme – vote: 1254
- You could just use some HTML in your Markdown:
- 在markdown里面使用html标签:
<img src=“drawing.jpg” alt=“drawing” width=“200”/>
- Or via
style
attribute (not supported by GitHub)- 或者使用
style
属性(GitHub不支持)
- 或者使用
<img src=“drawing.jpg” alt=“drawing” style=“width:200px;”/>
- Or you could use a custom CSS file as described in this answer on Markdown and image alignment
- 或者自定义CSS文件像这篇回答里说的:Markdown and image alignment
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-LdIb5agL-1624693150487)(drawing.jpg)]
- CSS in another file:
- 在其它文件的CSS:
img[alt=drawing] { width: 200px; }
- You could just use some HTML in your Markdown:
- prosseek – vote: 662
- With certain Markdown implementations (including Mou and Marked 2 (only macOS)) you can append
=WIDTHxHEIGHT
after the URL of the graphic file to resize the image. Do not forget the space before the=
. [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-hEAowbNU-1624693150488)(./pic/pic1_50.png =100x20)]
- You can skip the HEIGHT
- 可以省略高度
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-19jm9BvG-1624693150489)(./pic/pic1s.png =250x)]
- With certain Markdown implementations (including Mou and Marked 2 (only macOS)) you can append
- kushdilip – vote: 405
- The accepted answer here isn’t working with any Markdown editor available in the apps I have used till date like Ghost, Stackedit.io or even in the StackOverflow editor. I found a workaround here in the StackEdit.io issue tracker.
- 这段看不懂,机翻也看不懂,不过下面这句我看懂了,所以问题不大。
- The solution is to directly use HTML syntax, and it works perfectly:
- 直接使用HTML语法就好了,非常完美:
<img src=“http://…jpg” width=“200” height=“200” />
- The accepted answer here isn’t working with any Markdown editor available in the apps I have used till date like Ghost, Stackedit.io or even in the StackOverflow editor. I found a workaround here in the StackEdit.io issue tracker.
- Tieme – vote: 1254