Search code examples
cssweb-inspector

how to fix greyed out code in inspect element site


I've put an image in the background of a website I'm building, but it's not showing up. I ran inspect mode through Google chrome and the image is greyed out and not being applied.

what inspect mode is displaying

My css code:

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

I don't have the image listed in the index.html, but it is saved in the images folder. Other images that are listed in the index.html show-up.

I'm creating this site under localhost before publishing it, so I don't have a link to post. However, a link to the image is below. what the page looks like


Solution

  • Is the image located in the same folder as your index.html? If it is in another folder then you need to reference the file path. Here's a link regarding file paths. I encourage you to read on it. You mentioned in it's in a different folder, you have to type that file path on background-image: url(FILE PATH HERE)