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
Clayton Newberry
3,152 PointsCan't figure out whats wrong.
Question:
"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."
.box {
background-color: #387ABC;
background-image: url('../img/mike.png') no-repeat;
}
6 Answers
Gavin Foster
135 PointsYou've used shorthand in background-image. Take off the 'no-repeat' in background-image and declare the repeat like this
background-repeat: no-repeat;
Baraka Mahili
2,987 PointsThis worked for me :)
.box { background-color: #387ABC; background-image: url("img/mike.png"); background-repeat: no-repeat; }
MUZ140150 Yaso
6,651 Points.box { background: #387ABC; background-image: url("img/mike.png"); background-repeat: no-repeat; }
Gavin Foster
135 PointsHehe good stuff!
Davida Pitts
Courses Plus Student 5,301 Pointswhy in this particular exercise will only pass when using double quotes for the url instead of single quotes? from my understanding you can use either and in past exercises i used single quotes fine.
Kyle Bridges
Courses Plus Student 5,160 PointsDavida Pitts your right, you can use single or double quotes, It shouldn't matter but it forces you to use double in this exercise.
Clayton Newberry
3,152 PointsClayton Newberry
3,152 PointsI have tried that and it says to "Check the background-image value in your CSS"?
Clayton Newberry
3,152 PointsClayton Newberry
3,152 PointsI have tried that and it says to "Check the background-image value in your CSS"?
Clayton Newberry
3,152 PointsClayton Newberry
3,152 PointsI got it, thanks for the help!
Gavin Foster
135 PointsGavin Foster
135 PointsOK. Let's make sure your code looks exactly like this (make sure that the semi-colons are all there too):
.box { background-color: #387ABC; background-image: url('../img/mike.png'); background-repeat: no-repeat; }
Is that the case?
You can also use shorthand:
.box { background: #387ABC url('../img/mike.png') 0 0 no-repeat; }