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
Kelvin Yu
2,554 PointsBuild 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
Justin Hunter
Courses Plus Student 11,484 PointsAre 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;}
James Barnett
39,199 Points> 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
Wayne Priestley
19,579 PointsYou 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.
Yichang Liu
4,688 PointsTry:
background: #420600 url(img/texture.png) repeat;
You can format your text with Markdown.
Kelvin Yu
2,554 PointsThanks 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-")
Kelvin Yu
2,554 PointsKelvin Yu
2,554 PointsYou'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?
Justin Hunter
Courses Plus Student 11,484 PointsJustin Hunter
Courses Plus Student 11,484 PointsI 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!