Results 1 to 4 of 4

Thread: Background image in Container is not showing up

  1. #1
    Join Date
    Jun 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Background image in Container is not showing up

    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;

    }

  2. #2
    Join Date
    Jun 2008
    Location
    Norwich, UK
    Posts
    5
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    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;

    }

  3. #3
    Join Date
    Jun 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default follow up

    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..

  4. #4
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Surround the entire page in a container div and add margin:0 auto; to it's CSS.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •