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

Build a Simple Website: Stage 4, Challenge Task #4 (code challenge)

Code challenge is asking me to "Add the background texture.png from inside the img folder and set the background to repeat."

This is what I have in my CSS sheet, but the task is not letting me pass (sorry for the lack of formatting, I could not find instructions on how to format text for code, let me know how and I will make changes immediately):

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

I've tried switching from: url('img/bg-texture.png')

to: url('img/bg-texture.jpg')

and typing out the full path as so: url('images/background.png')

but still cannot pass the challenge. Any help would be greatly appreciated.

5 Answers

Are you sure the file name is bg-texture.png? Based on the question, which I assume you copied and pasted, it says add the background texture.png. So it should be body { font-family: 'Nunito', sans-serif; color: #FAF3BC; background: #420600 url('img/texture.png') repeat;}

You're right, thanks for the correction!

My question though, is why would the video tutorial tell us to use "url('img/bg-texture.jpg') and letting us know that "bg" stands for background? Is that just because where Nick (video guide) had stored his file?

I think that is probably where your confusion stemmed from. Be careful not to take too much of the video tutorial (word for word I mean) and apply it to the code challenges. The challenges will be very specific in what they want you to do. Glad I could help!

> Add the background texture.png from inside the img folder and set the background to repeat

Try re-reading the instructions, it asks you to use texture.png as your background not bg-texture.png

You have #420600 then url,

try removing #420600 that should do you, if you still have a problem try these.

in your url add ../ before img

make sure your folder that holds the image is called img

you may need to use background-image:

some or all of these changes should get you through.

Try:

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

You can format your text with Markdown.

Thanks for your help guys. No bug, just needed to remove the "bg-".

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

(EDIT: correct answer is "background: #420600 url('img/texture.png') repeat;"....w/o the "bg-")