在Markdown中更改图像大小
本文翻译自:Changing image size in Markdown
I just got started with Markdown. 我刚开始使用Markdown。 I love it, but there is one thing bugging me: How can I change the size of an image using Markdown? 我喜欢它,但是有件事困扰着我:如何使用Markdown更改图像的大小?
The documentation only gives the following suggestion for an image: 该文档仅对图像提供以下建议:
![drawing](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的工作方式。
#1楼
参考:https://stackoom.com/question/zZsH/在Markdown中更改图像大小
#2楼
If you are using kramdown , you can do this: 如果使用kramdown ,则可以执行以下操作:
{:.foo}
![drawing](drawing.jpg)
Then add this to your Custom CSS : 然后将其添加到您的自定义CSS中 :
.foo {text-align: center;width: 100px;
}
#3楼
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 或者,您可以按照本答案中关于Markdown和图像对齐的说明使用自定义CSS文件
![drawing](drawing.jpg)
CSS in another file: CSS在另一个文件中:
img[alt=drawing] { width: 200px; }
#4楼
You could use this one as well with kramdown: 您也可以将其与kramdown一起使用:
markdown
![drawing](drawing.jpg)
{:.some-css-class style="width: 200px"}
or 要么
markdown
![drawing](drawing.jpg)
{:.some-css-class width="200"}
This way you can directly add arbitrary attributes to the last html element. 这样,您可以将任意属性直接添加到最后一个html元素。 To add classes there is a shortcut .class.secondclass . 要添加类,有一个快捷方式.class.secondclass 。
#5楼
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. 使用某些Markdown实现(包括Mou和Marked 2 (仅macOS)),您可以在图形文件的URL后面附加=WIDTHxHEIGHT
以调整图像的大小。 Do not forget the space before the =
. 不要忘记=
之前的空格。
![](./pic/pic1_50.png =100x20)
You can skip the HEIGHT 您可以跳过高度
![](./pic/pic1s.png =250x)
#6楼
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 Stack Overflow editor. 到目前为止,这里接受的答案不适用于我迄今为止使用过的应用程序(例如Ghost,Stackedit.io或什至是Stack Overflow编辑器)中可用的Markdown编辑器。 I found a workaround here in the StackEdit.io issue tracker . 我在StackEdit.io问题跟踪器中找到了一种解决方法。
The solution is to directly use HTML syntax, and it works perfectly: 解决方案是直接使用HTML语法,并且效果很好:
<img src="http://....jpg" width="200" height="200" />
I hope this helps. 我希望这有帮助。
在Markdown中更改图像大小相关推荐
- 如何在iOS和WatchKit中更改图像tintColor
本文翻译自:How can I change image tintColor in iOS and WatchKit I have an UIImageView called "theIma ...
- LabVIEW中调整图像大小
LabVIEW中调整图像大小 需要调整LabVIEW前面板上图像的大小.可以如何操作实现? 基础版.完全版和专业版的LabVIEW开发环境本身并不包含用以图像处理的内置VI. 但是可以通过调用二维图像 ...
- 如何修改markdown中图片的大小
目录 1 方法1 2 方法2 1 方法1 这是在CSDN中上传图片后的格式,pic.png为图片,在CSDN中会是很长的图片链接,在后面添加一个空格,再加上=100x20,数字为长宽,修改这个数字即可 ...
- markdown中修改图片大小
在markdown中想修改图片大小应如何做呢?一起看看吧
- 如何在Powerpoint中更改幻灯片大小
PowerPoint allows you to format and present the content of your slides in different ways. If you wan ...
- linux如何调整文本大小,如何在Ubuntu 18.04 LTS中更改文本大小
在使用Ubuntu系统时,如果您在阅读屏幕上的文本时遇到困难,可以根据您的视力要求通过多种方法对其进行修复. 在本文中,我们将介绍三种在Ubuntu中更改屏幕文本大小的方法. 我们已经在Ubuntu ...
- java处理图像减小大小不改变像素_在Java中调整图像大小以降低内存消耗
ImageMagick的"转换"命令行工具使您可以在执行操作时指定内存使用限制. 我想找到一个提供相同选项的Java图像大小调整库. 我的应用程序有时会获得非常大的JPEG,因此需 ...
- php 降低图像大小,在PHP中调整图像大小
我想写一些PHP代码,自动将通过表单上传的任何图像大小调整为147x147px,但我不知道如何去做它(我是一个相对PHP新手). 到目前为止,我已经成功上传图片,文件类型被识别和名称清理,但我想添加r ...
- cssbefore图片大小_我可以在CSS:before /:after伪元素中更改图像的高度吗?
由于我的其他答案显然没有被很好地理解,因此这是第二次尝试: 有两种方法可以回答这个问题. 实用(只给我看该死的照片!) 忘记:after伪选择器,然后去做类似的事情 .pdflink { min-he ...
最新文章
- 透过率和反射率的关系_光谱仪应用|色彩、透过率等四款测量系统
- 解决 Android java.lang.RuntimeException: Stub!
- 我的小作品(烂笔头)
- 睡觉时憋气发出“嗯嗯”的声音?
- Session id的存储
- 我的世界中国版服务器地图文件在哪,我的世界中国版手机版联机的地图保存在哪 | 手游网游页游攻略大全...
- 微服务架构的优缺点_微服务架构DNS服务注册与发现实现原理
- 大学计算机基础方案一,大学计算机基础案例教学与教学案例策划.doc
- mac上使用终端生成RSA公钥和密钥
- micropython入门指南-【micropython入门指南 】读后感 一
- 人人都说风口的二次元还是门好生意吗?——动漫市场分析
- 用计算机读取三菱PLC程序,电脑如何读取与保存三菱plc数据?
- 使用树莓派来做打印服务器
- 机器学习的算法分类、优劣比较和选择
- 畜牧业的论文发表一般多少钱
- 3、xx配音狂app登陆算法分析【Android逆向分析学习】
- python中的标准输入设备_从MIDI设备获取输入(Python)
- post提交数据返回404错误
- DEI脉冲发生器维修高压电源维修PVX-5500
- Gradle如何排除依赖项目的某些包