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

how to add an image in the background

i saved the background image in the ing folder and written the following code for background image

body { font-family: 'Nunito', sans-serif; color: #faf3bc; background: url('img/tileable_wood_textur.png'); }

but i am unable to see the image in the background . so please tell me what to do

3 Answers

where is css located? may be it is in a subfolder.. try url(../img/wood_texture.png); the url is relative to the css file.

its the correct answer, thanks so much for saving my day

Try this:

body
{
background-image:url('img/tileable_wood_textur.png');
}

not working please u also try with some other image i think its not working out

Harsha,

Hmm I have a hunch as to the problem.

What folder are you putting your CSS files which contains the code above?? What folder are you putting your image files?

i have saved the images in the file named img

i have saved images in img folder and css files in css folder