Stackoverflow热门问题(十四)-改变Markdown图片的大小的方式

文章首发及后续更新:https://mwhls.top/2657.html
新的更新内容请到mwhls.top查看。
无图/无目录/格式错误/更多相关请到上方的文章首发页面查看。

stackoverflow热门问题目录

如有翻译问题欢迎评论指出,谢谢。

改变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
      • 想使用markdown语法来实现的话(包括MouMarked 2(仅macOS)),可以通过添加=WIDTHxHEIGHT在图片URL的后面来设置图片大小(=前需要空格)。
      • [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-QkGRQSnw-1624693150478)(./pic/pic1_50.png =100x20)]
      • 可以省略高度
      • [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-yd7CeyI2-1624693150482)(./pic/pic1s.png =250x)]
    • 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” />

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实现的。
  • 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
      • [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-LdIb5agL-1624693150487)(drawing.jpg)]
      • CSS in another file:
        • 在其它文件的CSS:
      • img[alt=drawing] { width: 200px; }
    • 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 =.
        • 想使用markdown语法来实现的话(包括MouMarked 2(仅macOS)),可以通过添加=WIDTHxHEIGHT在图片URL的后面来设置图片大小(=前需要空格)。
      • [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-hEAowbNU-1624693150488)(./pic/pic1_50.png =100x20)]
      • You can skip the HEIGHT
        • 可以省略高度
      • [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-19jm9BvG-1624693150489)(./pic/pic1s.png =250x)]
    • 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” />

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值