...

View Full Version : background color does not cover over all the boxs in Firefox but IE does



kamkam
06-03-2009, 05:11 AM
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


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

drhowarddrfine
06-03-2009, 05:14 AM
Works for me.

kamkam
06-03-2009, 05:57 AM
strange, it doesn't work in my side. Thanks anyway.

kamkam
06-03-2009, 06:33 AM
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

SB65
06-03-2009, 07:58 AM
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.

kamkam
06-03-2009, 09:16 AM
Thanks a lot, it works now



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum