是否可以在一个GitHub存储库的README文件中放置一个截图?语法是什么?
当前回答
请休息这四步, 这对我很有效
1-在GitHub上创建一个新问题。 拖放图片到评论栏或上传照片。 3 .等待上传完成。 4 .复制URL并在GitHub上的Markdown文件中使用它(在存储库的自述中使用生成的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".
方法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 " />
如果你不想样式你的图像,即调整大小,删除样式部分
使用位于/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>
[截图](截图.png)就像上面提到的那样。将截图.png替换为您在存储库中上传的图像的名称。
但当你上传图片时,这里有一个新手提示(我自己也犯了这个错误):
确保映像名称不包含空格。我的原始图片被保存为“截图日月年id.png”。如果您不将名称更改为类似contenttofimage .png的名称,那么它将不会作为图像出现在自述文件中。
我发现在我的repo图像的路径是不够的,我必须链接到raw.github.com子域上的图像。
网址格式https://raw.github.com/{USERNAME}/{REPOSITORY}/{BRANCH}/{PATH}
降价示例
推荐文章
- GitHub -致命:无法读取用户名https://github.com':没有这样的文件或目录
- Github:我能看到回购的下载数量吗?
- 如何运行一个github-actions步骤,即使前一步失败,同时仍然失败的工作
- 当我试图推到原点时,为什么Git告诉我“没有这样的远程‘原点’”?
- 在GitHub repo上显示Jenkins构建的当前状态
- 如何取消在github上的拉请求?
- HEAD和master的区别
- 在另一个目录中运行操作
- GitHub克隆与OAuth访问令牌
- 我可以在GitHub上对要点进行拉请求吗?
- Git:在推送后删除提交的文件
- 在GitHub中编辑git提交消息
- Github:导入上游分支到fork
- GitHub上的分叉和克隆有什么区别?
- 如何将现有的解决方案从Visual Studio 2013添加到GitHub