i’m extremely frustrated right now. I can’t figure out why my container won’t extend to the bottom of the page. it reaches the bottom of the visible window, but if you scroll down past that, then the background ends.
my basic structure looks something like this…
<div id='container'>
<div id='content'>
/*Some Content here but all divs opened here are closed. (Title Bar, Nav, etc)
<div id='mainTableContainer'>
/*This is where a bulk of the code is. A table is generated in PHP and it
gets fairly lengthy.
</div>
</div>
</div>
So that’s basically the HTML. I can’t for the life of my figure out why #container won’t
extend to the bottom of the page!
And the CSS
html{
height:100%;
}
body {
font: 100%/1.4 "Museo-sans", Verdana, Arial, Helvetica, sans-serif;
background: #ccc;
margin: 0;
padding: 0;
color: #000;
height:100%;
background-image:url(images/bg.png);
}
.container {
width: 960px;
background: #FFF;
height:100%;
margin: 0 auto;
border-left-style:dashed;
border-right-style:dashed;
border-width:1px;
border-color:#bf0000;
}
.content {
height:100%;
padding: 10px 0;
}
#mainTableContainer{
margin:0px auto;
width:90%;
height:100%;
text-align:center;
}
I tried a lot of the tips I found on this site, but nothing was helping. I don’t think anything is floated. I tried setting all the heights to 100%, I tried setting a min width… I can’t figure it out!!
EDIT:
OK I MADE A JSFILDDLE
So if you shrink the size of the display second in jsfiddle to smaller than the table, and then refresh it, you’ll see that the background doesn’t go all the way down, and the table is left ‘floating’ in the air.
http://jsfiddle.net/LGM3y/1/
You’re trying to select a class, but container is an ID, so you need:
instead of
If that doesn’t fix it try setting the background CSS on the HTML tag instead of the container.
etc