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 trialRoohullah Hasani
Courses Plus Student 522 PointsHow 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
5,345 PointsTake out the semicolon after the hexadecimal color. I think that may be your solution as it is a syntax error.
Aaron Arkie
5,345 Pointsif 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
5,345 Pointswhen 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
5,345 Pointsi 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;
}
Roohullah Hasani
Courses Plus Student 522 PointsThanks alot :)
James Barnett
39,199 PointsJames 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
5,345 PointsAaron Arkie
5,345 PointsJames 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