'position: fixed' won't let me scroll. 'position: relative' won't stretch
the div. Which to use/how to fix?
thanks for helping out. I have a site with a container div that I'd like
to stretch to the bottom of the page. Using position: fixed I'm able to
achieve this, but the footer text on the bottom is cutoff and you are
unable to scroll down.
Using position: relative I'm able to scroll, but the container div does
not stretch to the bottom of the page.
My code is as follows:
<div class="container">
<div class="header"></div>
<div class="body">
content content content
</div>
<div class="footer"></div>
</div>
And the CSS:
.container {
position: relative;
bottom: 0;
top: 0;
left: 50%;
margin-left: -480px;
width: 960px;
height: auto;
background-color: #1b1a1a;
}
.body {
width: 703px;
min-height: 340px;
margin: auto;
background-color: #f2f2f2;
padding: 20px;
overflow: hidden;
}
No comments:
Post a Comment