是否可以在一个GitHub存储库的README文件中放置一个截图?语法是什么?
当前回答
方法1->降价方式

方法2->HTML方式
<img src="https://link(format same as above)" width="100" height="100"/>
or
<img src="https://link" style=" width:100px ; height:100px " />
如果你不想样式你的图像,即调整大小,删除样式部分
其他回答
将此添加到README
<div align="center">
<img src="/screenshots/screen1.jpg" width="400px"</img>
</div>
首先,在本地repo的根目录下创建一个目录(文件夹),其中将包含您想要添加的屏幕截图。让我们把这个目录的名称称为屏幕截图。将你想要添加的图片(JPEG、PNG、GIF等)放到这个目录中。
Android Studio工作空间截图
其次,您需要将每个图像的链接添加到README中。所以,如果我的截图目录中有命名为1_ArtistsActivity.png和2_AlbumsActivity.png的图像,我将像这样添加它们的链接:
<img src="screenshots/1_ArtistsActivity.png" height="400" alt="Screenshot"/> <img src=“screenshots/2_AlbumsActivity.png" height="400" alt="Screenshot"/>
如果你想让每个截图在单独的行上,把它们的链接写在单独的行上。但是,最好将所有链接写在一行中,仅用空格分隔。它可能看起来不太好,但通过这样做,GitHub会自动为你安排它们。
最后,提交您的更改并发布它!
使用位于/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>
下面一行应该就是你要找的内容
如果文件在存储库中

如果您的文件在其他外部url

从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".
推荐文章
- 在Markdown Jekyll中使用图像说明
- 如何修改GitHub拉请求?
- 如何在Github和本地删除最后n次提交?
- 如何将文件附加到GitHub问题?
- Slack Markdown链接没有解决
- 如何添加谷歌分析跟踪ID到GitHub页面
- 差异语法突出显示在Github Markdown
- 我如何创建一个文本框的笔记在markdown?
- /dist目录在开源项目中的意义是什么?
- 我如何从现有回购的分支创建一个新的GitHub回购?
- 在git中压缩提交是什么意思?
- 如何在GitHub上找到存储库项目的创建日期?
- 如何设置一个git项目使用外部回购子模块?
- 在Markdown中创建一个没有标题的表
- 强制LF eol在git的回购和工作副本