0

I am soo confused right now. Coding really isn't my thing, so I believe that I messed up majorly somewhere which creates this problem:

I'm trying to make a sticky footer. The footer does stick--but only if I make my main content DIV (the white centered box) relative. I need the height of that DIV to stretch with the content (which will contain a PHP script that'll pull from my Wordpress blog--so naturally, I need it to adjust as necessary). If the DIV stretches longer than 500px, there's a weird two-scrollbars things going on, & I hate that. I like the relative DIV, but I would love to rid of all the extra scroll space, as well as making sure it stetches/regresses with content & the footer stays where it is.

I hope that's not too confusing. I'd just like someone to look over my source code & see where I'm going wrong. Thank you for any help.

http://www.missa.me/practice3.php

4

1 回答 1

0

不错的网站:)

您需要固定页脚,

使用这个 CSS

#footer {
position: fixed;
height: 80px;
clear: both;
background-color: #fff;
bottom: 0;
left: 0;
right: 0;
}

overflow: auto;起飞#main

这样做是告诉页脚保持“固定”到视口的底部,因此它会始终粘在屏幕的底部..overflow:auto;起飞将使您#main有自然的能力根据里面的内容扩展它的高度它。

于 2013-04-25T15:02:49.807 回答