Background disappears

Discussion in 'CSS' started by gracebarreiros, Mar 30, 2008.

  1. #1
    I have 3 templates on a site done with Mambo.
    a) 3 column
    b) 2 column
    c) 1 column

    The problem is that the background on the one-column lay-out disappears in Safari e Firefox. Funny enough it is working on IE.

    The problem seems to be on the code:

    #container{

    position:static;
    top:10px;
    width:800px;
    height:auto;
    margin:0 auto;
    margin-top:10px;
    border:thin solid #000;
    background-color: #FFFFFF;
    }

    when I change to
    position:absolute; (or fixed) the background shows up, but I want the lay-out to be centralized

    I have reviewed the template and index.php, and can't figure out why this is happening.


    I appreciate any help.
     
    gracebarreiros, Mar 30, 2008 IP
  2. donniedarko

    donniedarko Member

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #2
    Is the background an image? Can you show the code where the background is inserted?
     
    donniedarko, Mar 30, 2008 IP
  3. DoOoM

    DoOoM Active Member

    Messages:
    188
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    58
    #3
    Sometimes the command "float" does that. If some of the elements are "floated" then the ones that aren't are sometimes missing in firefox for some reason.
     
    DoOoM, Mar 31, 2008 IP
  4. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #4
    DoOoM may have hit on it. If your container has float content, and you haven't taken steps to enclose your float elements, the container will have zero height. IE expands the container for the wrong reasons. Firefox would be the correct rendering.

    cheers,

    gary
     
    kk5st, Mar 31, 2008 IP
  5. gracebarreiros

    gracebarreiros Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Guys, You are GREAT. I deleted all the "floats" and it worked. God bless you all. Thanks a million!
     
    gracebarreiros, Mar 31, 2008 IP