html - 如何将图像添加到 github 网站上的导航栏
问题描述
我正在制作一个 GitHub 网站,并希望将网站徽标添加为背景图片。目前代码是
body{
<!--some other styling-->
background-image: url(/geekoicon.png)
}
我已将图像文件上传到 Github,但它不在任何文件夹中,但是如果我访问我的网站,则什么都没有显示。当我尝试将图像放入文件夹并将新路径放入一个替换不存在图像的小图标时,弹出。如果有帮助,这里是 Github 项目页面https://github.com/Geeko/geeko.github.io
解决方案
由于图像位于您的 CSS 的位置,因此https://raw.githubusercontent.com/Geeko/geeko.github.io/master/geekoIcon.png
您的 CSS 将如下所示:
body{
background-image: url(https://raw.githubusercontent.com/Geeko/geeko.github.io/master/geekoIcon.png)
}
请注意,Github 网站的工作方式您也可以使用较短的 URL 来引用它https://geeko.github.io/geekoIcon.png
推荐阅读
- css - CSS背景颜色在Safari中不起作用
- python - 如何在 Python 中调用函数内部的函数
- android - 暂停开放测试后,我的应用的 Google Play 评论是否会公开显示?
- discord - 向服务器的所有成员添加角色的代码
- statistics - 我想知道我所做的统计分析是否有意义
- elasticsearch - 在弹性搜索上不起作用的术语
- android - 未处理的异常:键入“列表”
' 不是 'String' 类型的子类型 无法获取 json 数据 - swift - 视图中的 AVFoundation 摄像头
- azure - Azure 与服务总线主题的集成
- clojure - cider-connect-clj 无法连接到 nrepl.server/start-server