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

John Lukacs
John Lukacs
26,806 Points

Background img wont show up using div

.side-a {
background-image:url('io.jpg'); 
}
.side-a {
background-image:url('io.jpg'); 
}

8 Answers

Grace Kelly
Grace Kelly
33,990 Points

Hi John, your code looks all good from what I can see which leads me to ask the following:

  1. Have you linked your css file inside your html file properly e.g is there any spelling mistakes in the name of the file/path directory etc?

  2. Have you linked the image file correctly (e.g spelling, file extension and path directory (if it's in an image folder make sure to include its path e.g img/io.jpg))?

John Lukacs
John Lukacs
26,806 Points
<div class="wrap">
<div class="side-a"></div>
<div class="side-b"></div>
</div>
John Lukacs
John Lukacs
26,806 Points

They pictures are in the same file in dreamweaver. Anyways I tried img/io.jpg and ../io.jpg and ../img/io.jpg none of them work. The css file is working

Grace Kelly
Grace Kelly
33,990 Points

hmm try giving the div a width and height, it could be because the image has nothing to fill that you aren't seeing anything on the screen....

John Lukacs
John Lukacs
26,806 Points

I was thinking about this to. I added 1400px of space. it opened up more room but no picture

John Lukacs
John Lukacs
26,806 Points

I added a background color and that seems to work but no picture

John Lukacs
John Lukacs
26,806 Points

Ok the height thing worked

John Lukacs
John Lukacs
26,806 Points

Now its not working it shows up in live view on dreamveaver then I click on the screen and it goes away

John Lukacs
John Lukacs
26,806 Points

Width:100% height:100% to the div worked