Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
312 views
in Technique[技术] by (71.8m points)

image - 在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的工作方式。)

  ask by cantdutchthis translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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; }

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...