部署后,CSS样式未在GitHub上显示

问题描述 投票:0回答:2

我现在已经在我的GitHub配置文件中提交了几个项目,并且对于每个项目,当在浏览器上部署项目时,不会出现任何CSS样式。它只显示纯HTML。我已经研究了堆栈溢出的答案,我已经尝试过向其他人建议的技术,但我仍然有相同的结果。

这是https://deniseo25.github.io/Excursion/页面的链接。

我的HTML代码:

<!DOCTYPE html>
<html>
  <head lang="en">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, inital-scale=1.0">
    <meta http-eqiv="X-UA-Compatible" content="ie-edge">
    <title>Excursion</title>
    <link href="./resources/css/style.css" type="text/css" rel="stylesheet"/>

  </head>
<body>
  <!--Landing Section-->

    <h1 class="header--main">Discover hidden places in the world around you</h1>
    <p><a class="link--cta" href="#">Download Excursion (Coming soon!)</a></p>
    <video autoplay muted loop>
      <source src="resources/videos/excursion.mp4" type="video/mp4">
    </video>

    <!--Information section-->

    <h2 class="header--secondary">Your personal travel guide</h2>
    <h4 class="header--subheader">Excursion remembers places you like, and recommends new points of interest around you.</h4>
    <p><img src="resources/images/camp.jpg" alt="camp"></p>

    <!--Coming Soon Section-->

    <p><img src="resources/images/phone.png" alt="phone"></p>
    <h4 class="header--subheader">Coming Soon for iPhone and Android</h4>
    <p><a class="link--cta" href="#">Download Excursion (Coming soon!)</a></p>

    <!--Footer Section-->

    <p class="footer-copyright">© Excursion</p>

</body>
</html>

html css github-pages
2个回答
0
投票

这是因为服务器在尝试加载样式表时返回404(未找到)。

Request code


0
投票

您为CSS提供的路径不正确

https://deniseo25.github.io/Excursion/resources/css/style.css 点击这里它将显示404

正确的道路是这样的 https://deniseo25.github.io/Excursion/Resources/CSS/style.css 请改变,它会工作 所以在头部,它应该是

<link href="./Resources/CSS/style.css" type="text/css" rel="stylesheet">
© www.soinside.com 2019 - 2024. All rights reserved.