简体   繁体   English

GitHub页面加载Bootstrap CSS,但不是我的自定义样式表?

[英]GitHub Page loading Bootstrap CSS, but not my custom stylesheet?

I am trying to host my website for free using GitHub (and I'm new to GitHub so sorry if this is a dumb question), but it just is not using the stylesheet I created and uploaded with all my files. 我正在尝试免费使用GitHub托管我的网站(并且我是GitHub的新手,如果这是一个愚蠢的问题,对不起),但是它没有使用我创建并上传了所有文件的样式表。 It also is not loading images from my images folder. 它还没有从我的图像文件夹中加载图像。 So from what I can tell, it doesn't like using local files, but it is fine using linked stylesheets like Bootstrap and images linked from somewhere online. 因此,据我所知,它不喜欢使用本地文件,但是使用链接样式表(如Bootstrap)和从在线某处链接的图像就可以了。

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="_css/bootstrapOverride.css">
<link rel="stylesheet" type="text/css" href="_css/animate.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">

It refuses to use my bootstrapOverride.css and the animate.css. 它拒绝使用我的bootstrapOverride.css和animate.css。

How can I make it use local files like these? 如何使用此类本地文件? Same question with images as well? 图像也有同样的问题吗?

I figured out the problem. 我解决了这个问题。 The issue was my folder names in linking to my stylesheets. 问题是我链接到样式表时的文件夹名称。 GitHub pages uses Jekyll and Jekyll ignores anything after an underscore. GitHub页面使用Jekyll,而Jekyll在下划线后会忽略任何内容。 Since the folder I had my CSS in was "_css" it would see the underscore and stop there. 由于我放入CSS的文件夹是“ _css”,因此它将看到下划线并在那里停止。 I took the underscores out of the folder names, updated my links to the CSS and now we are all good! 我从文件夹名称中删除了下划线,更新了指向CSS的链接,现在我们一切都很好!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM