图片和 CSS URL 路径无法解析到浏览器中的正确位置

Image and CSS URL paths not resolving to correct locations in browser

当我在 https://zeddrix.github.io/bible-query/, and looked at the path of my style.css, the path should be like this: https://zeddrix.github.io/bible-query/styles/style.css 上记录我项目的网络 activity 以访问我的 CSS。

但是我没有那个,而是继续 https://zeddrix.github.io/styles/style.css 而没有 /bible-query/ 这就是为什么找不到。

我的图像也发生了同样的情况。例如,而不是 https://zeddrix.github.io/bible-query/img/play-btn.jpg, I keep on having https://zeddrix.github.io/img/play-btn.jpg 没有 /bible-query/ 再次出现在 URL 上。

我期待这个(在实时服务器上):

但是,我继续使用这个(在 GitHub 页面上):

请帮帮我。这是我的存储库:https://github.com/zeddrix/bible-query

尝试从所有 URL 引用中删除第一个正斜杠。因此,<link rel="stylesheet" href="/styles/style.css" /> 将变为 <link rel="stylesheet" href="styles/style.css" />。这会将它变成 "relative" link,而不是绝对的 link。