CSS 样式显示不正确 (firebase)

CSS styles not displaying properly (firebase)

我在 Firebase 中部署了一个 SPA,CSS 样式只有在我刷新浏览器时才看起来不错。这是显示问题的简短视频:

https://www.youtube.com/watch?v=dIuQ-axizj8

我的firebase.json:

{
  "hosting": {
    "public": "build",
    "ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
    "rewrites": [
      {
        "source": "**",
        "destination": "/index.html"
      }
    ]
  }
}

似乎问题只与背景图像有关,因为应用程序的其余部分具有正确的样式。这是我的网站,因此您可以验证问题:https://ligafiferos.web.app/61159918604c7700164465bd/players

提前致谢!

不要在 .card 上使用 background: white;(在 Card.css 中定义),使用 background-color: white(这是您要更改的内容)。

更改快捷方式 属性 background 会更改所有 background-* 属性(包括 background-image,设置为 initial),然后您依赖CSS 加载顺序是否显示背景(这可能取决于很多因素)。

如果 Card.css 在 PlayItem.css 之后加载(出于某种原因),那么它将取消 .elche-item__content 属性 background-image 并将其替换为initial