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 trialElena Paraschiv
9,938 PointsIt does not work to add the background-image : url to body?
Hei. I seem to not be able to add the pattern to the body. I don't understand why. Imgur
4 Answers
Daan Grootenboer
12,479 PointsI think your relative path is wrong!
Try this...
body {
background-image: url("../img/eight_horns.png");
}
Take a look at this video for more explanation.
Elena Paraschiv
9,938 PointsThat worked out great! Thanks for the explaining video too
Julie Myers
7,627 PointsYou're CSS coding is correct. It is probably the path to the image that off a bit. Depending on how you have your file structure set up, you might need to do any of the following:
body {
background-image: url("../img/fileName");
}
body {
background-image: url("/img/fileName");
}
Daan Grootenboer
12,479 PointsAlmost at the end of the code you have this peace of code ...
body{
background-image:url("img/logo_x_pattern.png");
}
Try to remove this ;)
Daan Grootenboer
12,479 PointsDid you remove your second question?
Elena Paraschiv
9,938 PointsHi Dan, Yes. The problem got solved.I noticed that immediately after posting and deleted it.Thank you for your fast input nonetheless.
Steven Snary
17,540 PointsSteven Snary
17,540 PointsIs your index.html file in the simplu directory? The reason I ask is because your code is looking for the eight_horns.png file in an img directory off of the directory of the index.html file.
Also can you confirm that the extension of the eight_horns file is a png?