CSS不适用于github页面 [英] css not working for github pages
问题描述
我的CSS在我的github页面上无法正常工作.这是我的 repo .这是我的网站.我创建了没有Github页面的此投资组合网站,并且可以正常工作.我是github的新手,所以很可能我错过了一些东西.我通常将所有css/jscript本地化,但是出于简单原因,我将所有css/javascript都更改为html链接.
my css is not working correctly on my github page. This is my repo. This is my website. I created this portfolio website without Github pages and it works correctly. I am very new to github , so there is a good chance I'm missing something. I usually localize all my css/jscript but for simplicity reasons I changed all my css/javascript to the html link.
<!doctype html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css\main.css">
</head>
推荐答案
我的HTML文件和CSS文件有相同的问题.我是这样修复的:
I had the same problem with my HTML file and my CSS file. I fixed it like this:
- 我有一个带index.html的存储库和一个名为"style"的文件夹,其中包含style.css文件.
- 使用head标记内的link标记部署我的index.html,如下所示:
<link rel="stylesheet" href="./style/style.css" type="text/css">
请注意href属性:"./style/style.css".
Pay attention to the href attribute: "./style/style.css".
安迪.-
这篇关于CSS不适用于github页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!