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

HTML Build a Simple Website Styling Content Fonts and Colors

Xavier Vivas
Xavier Vivas
12,810 Points

Challenge task 4 of 4 - Add the background

I have added the css code like this with no results:

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

I think there's a bug or something wrong with that challenge.

Tks

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

5 Answers

Check the filename of the image. Also, you can pass without repeat. Probably because that's the default value if you don't set it.

In the example you posted above, you haven't closed the body tag with }

Xavier Vivas
Xavier Vivas
12,810 Points

I forgot to paste it on my question, but it is inserted in the code and it does not work. So I have it like this:

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

Any other suggestion?

Tks.

Xavier Vivas
Xavier Vivas
12,810 Points

Tks guys. I will just skip it as nothing seems to work. Cheers!

You changed the filename of the image and that didn't work?

You have to use the filename they specified in the instructions.

Xavier Vivas
Xavier Vivas
12,810 Points

Yes Jason, I used the .png but that didn't work, however, I applied the code as instructed by Jeff and that worked (although that was different from what the lesson taught). Tks both... case closed!

James Barnett
James Barnett
39,199 Points

> that worked (although that was different from what the lesson taught)

Be careful here and make sure to closely read instructions of each code challenge, there's no guarantee filenames in a code challenge will match the ones used in the corresponding video.