Https://www.codecademy.com/paths/web-development/tracks/styling-a-website/modules/local-website-development/projects/dasmoto

Hi, I’m having a problem with the ‘Dasmoto arts & crafts’ exercise.

I am trying to get an image 1 to be the background for the main title as shown in the spec document.

I am able to use a URL in my CSS code to do this task though I want to use a relative reference.

The directory structure I’m using for this is as follows:

  1. My root directory is called ‘Art project’
  2. In this folder are folders called ‘CSS folder’ and ‘Resources’
  3. In the ‘CSS folder’ is my CSS file ‘index.css’
  4. In the ‘Resources’ folder are my image files including the one I want to use ‘image_1.jpeg’

This is the code that I am using though I’m pretty sure that the relative path reference is wrong. What is the right relative path reference though?

h1 
{background-image: image("../Resources/image_1.jpeg")
}

https://www.codecademy.com/paths/web-development/tracks/styling-a-website/modules/local-website-development/projects/dasmoto

Forgive me in advance if I’m behind the times, but are you sure that image() is a supported CSS function?

I would have expected this, personally...
h1 
{background-image: url("../Resources/image_1.jpeg")
}

The .. to specify the parent directory is right, though.

1 Like

Thanks, this has worked!

The code above is accurate, maybe image() isn’t supported after all.