外部CSS无法与Github Pages一起使用 [英] External CSS not working with Github Pages
问题描述
我在GitHub Pages( http://evancase54.github.io 上有一个虚拟主机,我正在尝试链接到外部CSS文件,该文件是从根目录开始的一个文件夹.
I have a web host on GitHub Pages (http://evancase54.github.io), and I'm trying to link to an external CSS file, which is one folder from the root.
以这种方式尝试它不起作用:
Trying it in this way and it does not work:
<link rel="stylesheet" type="text/css" href="styles/index.css">
而且我不确定该怎么做.
<link rel="stylesheet" type="text/css" href="styles/index.css">
and I'm not sure how I am supposed to do it.
index.css
位于名为styles
的文件夹中,这显然是找不到的.我不知道这是什么引起的问题,所以如果有人可以帮助我,我将非常感激.
index.css
is located in a folder called styles
, and it's saying that apparently it's not found. I don't know the issue that's being caused here, so if someone could help me with this, I'd be very grateful.
推荐答案
我找到了解决方法.我显然没有使用根/
,所以它看起来像styles/index.css
而不是/styles/index.css
I found the fix. I apparently wasn't using the root /
, so it looked like styles/index.css
instead of /styles/index.css
这篇关于外部CSS无法与Github Pages一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!