外部CSS无法与Github Pages一起使用 [英] External CSS not working with Github Pages

查看:61
本文介绍了外部CSS无法与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屋!

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