github 页面中的图片和相关链接 [英] Images in github pages and relative links

查看:21
本文介绍了github 页面中的图片和相关链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个用户的 github 页面.

I created a user's github page.

现在,假设我在存储库的根目录中有一个图像文件,位于 Images/Emoticons/Cool.png

Now, suppose I have an Image file at the root of the repo located as Images/Emoticons/Cool.png

我尝试将该图像插入到我的主 Index.html 文件中.
我写-
- <img src="imagesemoticonscool.png"> 在线和离线都没有显示
- <img src="imagesemoticonscool.png"> 并且没有在线显示但我可以离线看到图像
- <img src="..imagesemoticonscool.png"> 在线和离线都没有显示

I try to insert that image in my main Index.html file.
I write -
- <img src="imagesemoticonscool.png"> and nothing shows up online and offline
- <img src="imagesemoticonscool.png"> and nothing shows up online but I can see the image offline
- <img src="..imagesemoticonscool.png"> and nothing shows up online and offline

应该怎么做?

推荐答案

由于该站点由 Linux 服务器提供服务,因此路径区分大小写.

As the site is being served by Linux servers, the path is case sensitive.

为了使此工作正常进行,请将提供的 url 中的 emoticons 替换为 Emoticons.

In order to make this work, replace emoticons with Emoticons in the provided url.

此外,在 URL 中,将反斜杠 () 替换为正斜杠 (/).

Also, in a URL, replace the backslash () by a forward slash (/).

以下 HTML 代码应该可以正确显示图像

The following HTML code should properly display the image

<img src="images/Emoticons/cool.png" alt="hi" class="inline"/>

这篇关于github 页面中的图片和相关链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆