是否可以在一个GitHub存储库的README文件中放置一个截图?语法是什么?


当前回答

尽管已经有了一个公认的答案,我想添加另一种方式来上传图片到GitHub上的自述。

你需要在你的回购中制造问题 拖放在评论区你的图像 图像链接生成后,将其插入到自述文件中

更多细节你可以在这里找到

其他回答

[截图](截图.png)就像上面提到的那样。将截图.png替换为您在存储库中上传的图像的名称。

但当你上传图片时,这里有一个新手提示(我自己也犯了这个错误):

确保映像名称不包含空格。我的原始图片被保存为“截图日月年id.png”。如果您不将名称更改为类似contenttofimage .png的名称,那么它将不会作为图像出现在自述文件中。

从2021年3月起,现在支持:

将文件附加到标记文件

You can now attach files, including images, to markdown files while you're editing them in the web. This works just like file attachments in issues and pull requests and supports the same file types. Just drag and drag, click and select, or paste. Note: If you add an image to a markdown file, anyone can view the anonymized image URL without authentication, even if the markdown file is in a private repository. To keep images private, serve them from a private network or server that requires authentication. For more information on anonymized URLs see "About anonymized image URLs".

2020年6月3日:工作答案-

把你的图片上传到postmage.org 上传图片后复制Github-Markdown-Url 插入你的ReadMe

点击右上角的绿色按钮创建一个新问题。截取你需要的任何内容的截图,并将其粘贴到问题消息中(Mac上的CMD+V或Windows上的CTR+V)。

使用位于/screen-shots目录中的图像。外部的<div>允许图像被定位。填充是使用<img width="desired-padding" height="0">实现的。

<div align="center">
        <img width="45%" src="screen-shots/about.PNG" alt="About screen" title="About screen"</img>
        <img height="0" width="8px">
        <img width="45%" src="screen-shots/list.PNG" alt="List screen" title="List screen"></img>
</div>