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

Can'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

You've used shorthand in background-image. Take off the 'no-repeat' in background-image and declare the repeat like this

background-repeat: no-repeat;

I have tried that and it says to "Check the background-image value in your CSS"?

I have tried that and it says to "Check the background-image value in your CSS"?

I got it, thanks for the help!

OK. 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; }

This worked for me :)

.box { background-color: #387ABC; background-image: url("img/mike.png"); background-repeat: no-repeat; }

.box { background: #387ABC; background-image: url("img/mike.png"); background-repeat: no-repeat; }

Hehe good stuff!

why 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.

Davida Pitts your right, you can use single or double quotes, It shouldn't matter but it forces you to use double in this exercise.