Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Dec 2006
    Posts
    306
    Thanks
    24
    Thanked 0 Times in 0 Posts

    background color does not cover over all the boxs in Firefox but IE does

    Hi;

    i don't known why background color does not cover over all the boxs in Firefox but IE does, could anyone help, please.

    my code as following

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <META HTTP-EQUIV="content-type" CONTENT="text/html; charset=utf-8">
    <style type="text/css">
    html,body{
      padding: 0;
      margin:0;
    }
    
    
    #container {
       position: relative;
       width: 796px; /* width + border for IE 5.x */
       w\idth: 790px; /* real width */
       height: auto;
       border: 0px;
       padding: 0;
       margin-top: 10px;
       margin-bottom:auto;
       margin-left: auto;
       margin-right: auto;
       background-color:#f0f0ec;
    }
    
    #wrapper{
     margin: auto;
     border:0;
     padding:0;
     width: 640px;
     height:auto;
    
    }
    .box{
     border:0;
     padding:0;
     width:190px;
     height:220px;
     float: left;
     margin-left:15px;
     margin-top:20px;
     background-color:#FFFF99;
     color:#333333;
     text-align:center;
     overflow:scroll;
    }
    </style>
    </head>
    <body>
    <div id="container">
    <div id="wrapper">
    //in here i am goning to use while loop to select all the data from database, so i may have 30 boxs, or 50boxs.
    <span class="box">
    gskjhdlk JAHDSLKAJSHD ADHSLKAHDLKSA HASDLADSLK ADHSAlds
    </span>
    <span class="box">
    gskjhdlk JAHDSLKAJSHD ADHSLKAHDLKSA HASDLADSLK ADHSAlds
    </span>
    <span class="box">
    gskjhdlk JAHDSLKAJSHD ADHSLKAHDLKSA HASDLADSLK ADHSAlds
    </span>
    <span class="box">
    gskjhdlk JAHDSLKAJSHD ADHSLKAHDLKSA HASDLADSLK ADHSAlds
    </span>
    <span class="box">
    gskjhdlk JAHDSLKAJSHD ADHSLKAHDLKSA HASDLADSLK ADHSAlds
    </span>
    <span class="box">
    gskjhdlk JAHDSLKAJSHD ADHSLKAHDLKSA HASDLADSLK ADHSAlds
    </span>
    </div>
    </div>
    
    </body>
    </html>
    Last edited by kamkam; 06-03-2009 at 06:13 AM.

  • #2
    Senior Coder
    Join Date
    Oct 2005
    Posts
    1,340
    Thanks
    0
    Thanked 61 Times in 60 Posts
    Works for me.

  • #3
    Regular Coder
    Join Date
    Dec 2006
    Posts
    306
    Thanks
    24
    Thanked 0 Times in 0 Posts
    strange, it doesn't work in my side. Thanks anyway.

  • #4
    Regular Coder
    Join Date
    Dec 2006
    Posts
    306
    Thanks
    24
    Thanked 0 Times in 0 Posts
    Could you visit the link of http://www.thetopbottom.com/

    and see any different from the IE and Firefox.

    in my side, the background-color(:#f0f0ec) does not cover all the boxes in Firefox, But IE does

  • #5
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,957
    Thanks
    9
    Thanked 727 Times in 721 Posts
    I don't get any grey background at all in FF3. It's because all your boxes are floated within #container, and hence it doesn't have any height.

    Add overflow:auto to #container - this will clear the float at the end of #container, give it some height and hence the background will show.

  • #6
    Regular Coder
    Join Date
    Dec 2006
    Posts
    306
    Thanks
    24
    Thanked 0 Times in 0 Posts
    Thanks a lot, it works now


  •  

    Posting Permissions

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