Why am I getting an error message when trying to change the background-image?

Viewed 20

I am working on a website and I am trying to change the background image of the body but for some reason it is not working.

Error message: Failed to load resource: net::ERR_FILE_NOT_FOUND background-home-desktop.jpg:1

Code:

body {
  background-image: url(assets/home/background-home-desktop.jpg);
  background-color: black;
  color: #FFFFFF;
}

My files:

enter image description here

1 Answers

If you are calling it from the CSS folder. Then put '../' before assets.

Try it:

body {
  background-image: URL('../assets/home/background-home-desktop.jpg');
  background-color: black;
  color: #FFFFFF;
}
Related