Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS Build a Simple Website Styling Content Fonts and Colors

How to add the background texture.png from inside the img folder and set the background to repeat?

My code looks like this, and I cannot fine any problem in my code.

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

}

Please give me the answer so I can pass the test.

5 Answers

Aaron Arkie
Aaron Arkie
5,345 Points

Take out the semicolon after the hexadecimal color. I think that may be your solution as it is a syntax error.

James Barnett
James Barnett
39,199 Points

> Please give me the answer so I can pass the test.

The question is now that you have given him the answer does he understand why it created a syntax error? If not, does it really help students new to CSS to learn how to debug their code?

Aaron Arkie
Aaron Arkie
5,345 Points

James Barnett makes a good point and i apologize for not giving you proper guidance beforehand.

i suggest you read the info on these links to have a better understanding on what you are typing which is a single line deceleration of background properties and to re-watch the video regarding CSS carefully so you can enhance your code .

https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties

http://www.webcredible.co.uk/user-friendly-resources/css/css-shorthand-properties.shtml

http://www.w3schools.com/cssref/css3_pr_background.asp

Aaron Arkie
Aaron Arkie
5,345 Points

if your bg-texture has an extension of png substitute jpg for png. You put

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

}
Aaron Arkie
Aaron Arkie
5,345 Points

when it should be(if it is a png extension)

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

}
Aaron Arkie
Aaron Arkie
5,345 Points

i see the problem now here is the exact code:

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

Thanks alot :)