Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Trey Johnson
PLUS
Trey Johnson
Courses Plus Student 1,641 Points

Styling Content- Q: Add background texture.png from inside the img folder and set background to repeat.

/* Write your CSS below */

body{
  font-family:'Nunito',sans-serif;
  color: #FAF3BC;
  background: #420600 url('img/bg-texture.png')repeat; 
}

Says"Make sure to put relative path to image inside 'url()'.

2 Answers

Nick Pettit
STAFF
Nick Pettit
Treehouse Teacher

It looks like your image path is incorrect. Remember, your css file is inside the CSS folder. You need to navigate up the directory tree, and then back down into the images folder, like this:

../img/bg-texture.png

The two dots allow you to navigate upwards and move out of a folder, and then you can continue to move back down into another folder. Does that make sense? :)

Trey Johnson
Trey Johnson
Courses Plus Student 1,641 Points

I'm not following the two dots. I coded the exact way it's done in the video but I'm obviously missing something.

Nick Pettit
Nick Pettit
Treehouse Teacher

Hi Trey Johnson,

I just took another look. The directory navigation wasn't the problem. It's actually two other things:

  • The filename should be texture.png as it says in the instructions, not bg-texture.png
  • You need to add a space between the file path url and the keyword repeat in the background property.

So, with those two changes, your background property should look like this:

background: #420600 url('img/texture.png') repeat; 

Does that help? :)

Trey Johnson
Trey Johnson
Courses Plus Student 1,641 Points

And thanks for the feedback Nick, I actually took care of it yesterday by looking at a later video and saw the code.

nick that helped me alot i was stuck on this challenge thank you.

I know this has been addressed elsewhere, but please, in this case (beginner tutorial), could you change the wording in the code challenge to say "the image texture.png" or "the background image texture.png" instead of "the image background texture.png". I got eventually that the image name was different than the one you were using in the tutorial, and I can accept that curveballs are a part of the process... but this is just bad phrasing. It really makes it sound like the image name is "background texture.png" . . And I'm here for a refresher so I'm already used to these kinds of red herrings ...

--jus' sayin' : )