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 trialRandy Crowson
2,531 PointsNext, add the image 'mike.png' located inside the 'img' folder to the background. We only want Mike to appear once, so follow it with a property and value that will not repeat the image.
Stuck on this one.
.box { background-color:#387ABC; background-image: url('../img/mike.png'); background-repeat:no-repeat; }
1 Answer
Erik McClintock
45,783 PointsRandy,
The issue here is a minor one; you're telling the computer to look one directory up from where you are to find the img folder, when the img folder is on the level that your files are currently on.
Your code:
.box {
...
background-image: url("../img/mike.png");
...
}
The ../ says to back out one folder from your current folder, and then look for the img folder. You want to do this:
.box {
...
background-image: url("img/mike.png");
...
}
...because the img folder is in your current directory.
Erik