Log in

View Full Version : Background image in Container is not showing up



moonlighter44
06-04-2008, 06:32 PM
Hi,
I am pretty new to tableless layouts. The container div is giving me fits.
The body background is green, which is working
but the container has a repeating (x) image and a white background. Those do not show up unless i put some text in at the bottom of this div. (which you will see at the bottom). if i take that text out, the white background and the container img disappears and all you see is the body background color.

Help??
Thanks

here is the link:
http://creativeincolor.com/dl/

and the css:
body {
color: black;
background-color: #cbd6c2;
font: 12px Arial, Helvetica, Verdana, sans-serif;
text-align: center;
margin-top: 0;
}

#container {
color: black;
background-image: url(images/background1.gif);
background-color: white;
background-repeat: repeat-x;
width: 950px; /*Width of main container*/
margin: 0 auto; /*Center container on page*/
line-height: 1.8em;
text-align: left;

}

BlueStunt
06-04-2008, 09:18 PM
I'm not completely sure what the problem is, but have you tried setting a fixed height?

or use a minimum height

#container {
min-height: 400px;
color: black;
background-image: url(images/background1.gif);
background-color: white;
background-repeat: repeat-x;
width: 950px; /*Width of main container*/
margin: 0 auto; /*Center container on page*/
line-height: 1.8em;
text-align: left;

}

moonlighter44
06-04-2008, 09:19 PM
hey, i found an old forum that said to float the container. well that did fix the problem. the container is now showing up, but ....
with the container floated left, it's no longer centered on the page.
http://creativeincolor.com/dl/

one problem fixed, another created..

Medyman
06-05-2008, 01:06 AM
Surround the entire page in a container div and add margin:0 auto; to it's CSS.