Basic CSS question regarding background images for divs

Posted by Mike on Stack Overflow See other posts from Stack Overflow or by Mike
Published on 2010-05-03T18:16:04Z Indexed on 2010/05/03 18:28 UTC
Read the original article Hit count: 153

Filed under:

I'm a programmer trying to learn some css and I've already run into a stumbling block.

I have the following HTML:

<div class="container">
    <div class="span-24 last">
        Header
    </div>
    <div class="span-4">
        Left sidebar
    </div>
    <div class="span-16">
        <div class="span-8">
            Box1
        </div>
        <div class="span-4">
            Box2
        </div>
        <div class="span-4 last">
            Box3
        </div>
        <div class="span-16 last">
            Main content
        </div>
    </div>
    <div class="span-4 last">
        Right sidebar
    </div>
    <div class="span-24 last">
        Footer
    </div>
</div>

In my css I have the following:

body {
    background-color:#FFFFFF;
}

div.container {
    background:url(/images/bck.jpg);
}

I just want to display an image for the background area for the container div but nothing shows up. If I remove the background section from the css and add background-color:#000000; then I see a black background for the container div.

What am I overlooking?

© Stack Overflow or respective owner

Related posts about css