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 Build a Simple Website Styling Content Fonts and Colors

tamamelnatour
tamamelnatour
2,000 Points

Where is my mistake in challenge #4

body {
  font-family: "Nunito", sans-serif;
  color: #FAF3BC;
  background-color: #420600 url('img/texture.png') repeat; 
}

Here is my code in css file, in the last step the computer keep telling me that tak #3(which is background-color: #420600;) is no longer passing..... I don't know why?

tamamelnatour
tamamelnatour
2,000 Points

Thank you all, yes I know my mistake now and I set up the code to background only and it's work.

Hi,

Did one of the answers help you? If so could you make it as the best answer please?

Thanks

-Rich

4 Answers

Hi tamamelnatour,

I suspect maybe you meant to use the shorthand background property? You can't set the background color, background image, and repeat value using the the background-color property.

One option would be to switch to background:

background: #420600 url('img/texture.png') repeat;

Or continue to use the individual properties:

background-color: #420600;
background-image: url('img/texture.png');
background-repeat: repeat;

Technically you can even complete the challenge without setting the repeat value because this is the initial value.

Alex Heil
Alex Heil
53,547 Points

hi tamamelnatour , you're pretty close to the right answer ;)

the problem in your current code is that you're using background-color to add both the color value and the image to it. unfortunately you can't set an image to background-color, instead to add both values in one statement you'd use the shorthand background.

so at the end the declaration would look like this:

background: #420600 url('img/texture.png') repeat;

hope that helps and have a nice day ;)

Kevin Kenger
Kevin Kenger
32,834 Points

Hey tamamelnatour,

Change background-color to background. You've got image values inside of the background-color property and that's what's giving you the error.

Hi,

Can you try replacing:

background-color: #420600 url('img/texture.png') repeat;

with:

background: #420600 url('img/texture.png') repeat; 

Does this resolve the issue?

Thanks

-Rich