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

help!!! background: ; is driving me crazy (for my body paragraph)

Hello!! I'm trying to add a background into the body of all my pages, but it's not working. Doesn't appear anything. However, if I add a background color, there is no problem. this is it: I'm using an external CSS

body { background: #420600 url('images/background.jpg') repeat; }

It only shows the color I put. By the way, I have that image into the right folder, and everything seems to be in order.

I need some help. I don't really understand what's going on here.

6 Answers

The 2 most common mistakes when images are not showing up are a typo with the file names or using the wrong file path, so triple check the file name and path.

Here's a tutorial on file paths that should get you going.

Let us know how you are getting along with this here in this thread.

What folder is your CSS in? Looks like a file structure problem.

If your CSS is in a /css/ folder, you'll need to use ../images/background.jpg to first go down to your root directory, and then up through images and select your image.

Is it also possible you have something else overriding that bit of code? Try adding !important to it before the closing ; to give that line priority and see if that makes a difference.

Adam is right, it's a question of root path versus relative path. Instead of doing this:

body { background: #420600 url('images/background.jpg') repeat; }

try this:

body { background: #420600 url('/images/background.jpg') repeat; }

see the difference?

The name of the image is background.jpg, and it is in my images folder. So, I don't really understand where is the problem here. I'm using other images from the same folder (images) and they work.

HAHA.. Never mind, people I see where is the problem The image should be placed into my css folder lol Instead, it was into my folder of my images Well, thank you for the help guys

However, I would like you guys to tell me how I can put an image horizontally. I have this image right, and I want to know if there is a value that can do that. Of course into my CSS.