在 Markdown 中更改图像大小 [英] Changing image size in Markdown

查看:50
本文介绍了在 Markdown 中更改图像大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始使用 Markdown.我喜欢它,但有一件事困扰着我:如何使用 Markdown 更改图像的大小?

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?

文档仅对图像给出以下建议:

The documentation only gives the following suggestion for an image:

![drawing](drawing.jpg)

如果可能的话,我希望图片也居中.我要的是一般的 Markdown,而不仅仅是 GitHub 是如何做到的.

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 中使用一些 HTML:

You could just use some HTML in your Markdown:

<img src="drawing.jpg" alt="drawing" width="200"/>

或者通过 style 属性(GitHub 不支持)

<img src="drawing.jpg" alt="drawing" style="width:200px;"/>

或者您可以使用上的此答案中所述的自定义 CSS 文件Markdown 和图像对齐

Or you could use a custom CSS file as described in this answer on Markdown and image alignment

![drawing](drawing.jpg)

另一个文件中的 CSS:

CSS in another file:

img[alt=drawing] { width: 200px; }

这篇关于在 Markdown 中更改图像大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆