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

James Pointer
James Pointer
5,257 Points

Challenge 4/4 of Fonts and Colours not working?

Hi, I'm having a problem with the last part of the fonts and colours challenge, it is requiring me to link the 'texture.png' file into the background however when I do this, instead of it telling me where I went wrong it is saying that challenge 3 is no longer passing.. It's driving me crazy as I really can't see where I have gone wrong.. This is what I have:

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

I really hope someone can help as I don't want to miss out on any parts of this course, it's amazing so far. Thanks in advance.

4 Answers

When you combine background elements you need to use the generic "background" element, not "background-color":

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

See the section on "CSS Background Shorthand" at HTML Goodies.

When you join all the attributes of the background, you shouldn't specify one in particular. For example. If you write:

background-color: #000000;

background-image: url("#");

That's fine. But when you join them:

background-color: #000000 url("#");

Are you sure you're only specifying the background color?

James Pointer
James Pointer
5,257 Points

It's supposed to be joined I think as the 'texture.png' is what should be showing with the #FAF3BC being the fallback incase the browser can't show the image?

Thanks for replying.

I'm sorry for not being too specific, I didn't want to give you the answer right away.

James Pointer
James Pointer
5,257 Points

That's alright, your answer was helpful aswell, I would of gotten there in the end using what you said after a bit of tweaking, so thank you aswell :)

James Pointer
James Pointer
5,257 Points

Thank you so much! You've just cheered me right up! Thanks alot :)

Great! Happy to help. :)