CSS background-image Problem

I am having a problem with the background-image CSS property. I am using a relative file path. This is my file tree:
This is my CSS code:

  color: khaki;
  text-align: center;
  text-decoration: darkkhaki wavy underline;
  font-size: 100px;
  background-image: url(./recources/images/pattern-background.jpeg);

For some reason, the background image does not appear behind the text with the “title” id. I also tried the file path without the dot in front of the slash. Can anyone help?
Shane :smile:

You are making the relative file path reference to something inside ./ (which in this case is /recources/css). Try ../images/pattern-background.jpeg (which, from the root, looks like /recources/images/pattern-background.jpeg).

And in case you were being picky about spelling… Should be “resources”, not “recources”.

1 Like

Thanks @825orion! I’ll try that.

1 Like

Thanks so much @825orion ! This really helped! By the way, do you know how to change your Codecademy Discuss username? I noticed your username was different than the default. Thanks again!

You need to change it on the main Codecademy account page, before logging out everywhere and then back in. :slight_smile:


Okay, thanks @thepitycoder!

1 Like