【问题标题】:Github pages not rendering CSS correctly as it is locallyGithub 页面无法正确呈现 CSS,因为它是本地的
【发布时间】:2023-01-24 16:09:24
【问题描述】:

CSS 未按预期呈现 ReactApp,因为它是本地的。

在 Github 上

在本地

不附加任何代码,但是如果您需要任何特定文件,请告诉我将相应地编辑问题。

编辑

【问题讨论】:

  • 你看到 css 在 GitHub 上下文中正确加载了吗?就像在开发工具的网络选项卡中一样?
  • 是的,一切似乎都很好。使用屏幕截图更新了问题

标签: reactjs github-pages


【解决方案1】:

我似乎是 position: fixed 导致了这个问题:

早些时候:

.navbar-custom {
    z-index:100; 
    position: fixed;
}

之后:

.navbar-custom {
    z-index:100; 
    /* position: fixed; */
}

另外,请确保禁用缓存::

【讨论】:

    猜你喜欢
    • 2020-08-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多