如何修复检查元素站点中的灰色代码

how to fix greyed out code in inspect element site

我在我正在建立的网站的背景中放了一张图片,但它没有显示出来。我 运行 通过 Google chrome 检查模式,图像变灰且未应用。

我的css代码:

body {
    font-family: Raleway;
    margin: 0;
    background-image: url(background.png);
}

我没有 index.html 中列出的图像,但它保存在图像文件夹中。 index.html 显示中列出的其他图像。

我在发布之前在 localhost 下创建了这个网站,所以我没有 link 到 post。但是,下面是图像的 link。 what the page looks like

图像是否与您的 index.html 位于同一文件夹中?如果它在另一个文件夹中,则需要引用文件路径。 Here's a link regarding file paths。我鼓励你阅读它。您在其中提到它位于不同的文件夹中,您必须在 background-image: url(FILE PATH HERE)

上键入该文件路径