html - 在 github 配置文件 README 中显示图像?

标签 html image github favicon readme

可以通过创建格式为 username/username 的存储库来创建 github 配置文件 README。自述文件将显示在用户个人资料中的固定存储库上方。

但是,有些图片不显示,从一些人工测试来看,它似乎与尺寸或图片文件大小有关。

图像必须满足什么规范才能在原本为空的配置文件 README 中正确显示?也就是说,一个配置文件自述文件仅包含:

<img src="https://github.com/favicon.ico" height="240" width="480">

注意:这是加载图片失败时 README 的显示方式:

Issue

最佳答案

解决方案(通过来自 github 支持的电子邮件):

If you drag and drop an image into a pull request or issue comment it will automatically generate a link to the file on githubusercontent.

这会产生完美运行的代码:

![](https://user-images.githubusercontent.com/12915136/87480122-ab9e5e00-c5fa-11ea-82b1-b4d3340b5c27.png)

在原始代码中只有一些图像会按预期显示的原因是由于错误(此错误已被报告)

关于html - 在 github 配置文件 README 中显示图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62893869/

相关文章:

PHP 显示缩小和调整大小的图像

github - 云构建 "Google Cloud Platform was not authorised to list repositories"

git - Tomcat/Hudson 无法连接到 Github

html - div + 滚动 + 固定底部 + 可变顶部

javascript - 如何动态设置iframe高度?

html - 部分应用了 CSS 规则

c# - 如何在 MVC 中的另一个页面中显示 html 页面的一部分

javascript - 使用纯 Javascript 输入类型文件检查图像分辨率

image - 设置引用点以将数据叠加到 R 中的图像上

github - 如何让 Ionic 在代理后面工作? (错误 : getaddrinfo ENOTFOUND github. com github.com:443)