【问题标题】:External CSS not working with Github Pages外部 CSS 不适用于 Github 页面
【发布时间】:2016-11-24 12:45:09
【问题描述】:

我在 GitHub Pages (http://evancase54.github.io) 上有一个网络主机,我正在尝试链接到一个外部 CSS 文件,它是根目录下的一个文件夹。

这样试了还是不行:

<link rel="stylesheet" type="text/css" href="styles/index.css"> 我不知道我应该怎么做。

index.css 位于一个名为styles 的文件夹中,它表示显然没有找到它。我不知道这里引起的问题,所以如果有人可以帮助我解决这个问题,我将非常感激。

【问题讨论】:

    标签: html github


    【解决方案1】:

    路径区分大小写,

    Styles/index.css 应该可以工作

    或者您可以将其重命名为小写。

    【讨论】:

    • 我找到了解决方法,但事实并非如此。我显然没有使用根 /,所以它看起来像 styles/index.css 而不是 /styles/index.css
    【解决方案2】:

    我找到了解决办法。我显然没有使用根 /,所以它看起来像 styles/index.css 而不是 /styles/index.css

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-06-19
      • 2022-10-21
      • 2022-08-16
      • 2022-01-06
      • 1970-01-01
      • 2017-09-12
      • 2022-12-12
      相关资源
      最近更新 更多