Cannot get Background Image to appear in browser


#1

Hi there,
I’m stuck on a really basic part of the Codecademy Pro Intensive course - part 4 - Learn the Command Line, the exercise to build website for Broadway. I’m only just writing the css, and I cannot manage to get the background image of the flat iron building to magically appear behind the white header text. (In the attached image I’ve coloured the text blue so you can see it). I’ve tried changing the background image just to a background colour and that works - so it must be something to do with how I’ve written the instructions for using a background picture. Have tried changing the directory path, with and without quotes, but cannot get it to appear in the browser page. Are there any suggestions out there? I’ve spent so many hours!
TIA x


151029
(upload://zbvanKdiut73afy2yAbrcxEncOd.png)![53|644x339]

<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/courses/freelance1-u3/projects/f1-broadway?program_content_id=06b50388fa5672e84231fb4dd81cce3b&program_id=fb16da307e82259e33268848a624db9c

```
<do not remove the three backticks above>

#2

The style sheet is in a different folder and cannot see the image on the path you have given. Jump out of the css folder and back down into the images folder.

"../images/..."

#3

Oh - that works! How could I have wasted so long on such a silly an obvious mistake! Thank you kind saviour!


#4

Aside

I don’t know how much this applies in today’s terms, but I have two categories of images:

  1. Those that I want to have indexed, so do SEO (alt, title, caption, placement in page); and,
  2. Those that are intended as window dressing that I call skin images, and which I do not want indexed.

The first kind go in the folder that search engines look for… images. The second kind go in a skins folder inside the css folder. Then there is no need for a relative path to the images folder.

selector {
    background-image: url(skins/bgimage.png);
}

#5

Thanks for the tip! I’ve made a note for the future - when I’m a bit more adept.


#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.