CSS div页脚和列高问题
我这里有两个问题: http://jsfiddle.net/BtGtT/3
The第一个问题是页脚应始终位于页面底部,因此如果我将“otherContent”div
更改为 75px 而不是 1500px,页脚应保留在页面底部页面(当我将其改回 1500px 时,不在中间)。我不知道如何更新我的 CSS 来实现这一点。
第二个问题是我需要“contentLeft”和“contentRight”div
始终与“contentCenter”相同高度<代码>div。因此,当我像 JSFiddle 中那样将“otherContent”div
更新为 75px 或 1500px 时,“contentLeft”和“contentRight”div
应该与之匹配。这可能吗?
在我的实际网页中,我有一个
控件,其中的内容可能具有不同的高度。我想让我的侧栏与中心内容的高度相同。
I've got two problems here: http://jsfiddle.net/BtGtT/3
The first problem is that the footer should always be at the bottom of page, so if I change my "otherContent" div
to be 75px instead of 1500px, the footer should remain at the bottom of the page (and not in the middle when I change it back to 1500px). I'm not sure how to update my CSS to make that happen.
The second problem is that I need my "contentLeft" and "contentRight" div
s to always be the same height as my "contentCenter" div
. So when I update my "otherContent" div
to be 75px or 1500px like in the JSFiddle, the "contentLeft" and "contentRight" div
s should match that. Is this possible?
In my actual web page, I've got an <ASP:ContentPlaceHolder>
control and the content within could be of varying height. I'd like to keep my side columns the same height as whatever the center content might be.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

粘性页脚 和 假列
更多信息:
阅读这个。 CSS(至少是 2)确实在解决这个问题。因此,您的一些选择是:
repeat-y
平铺图像以给出全长列的错觉所有这些都有其优点,以及不同的浏览器支持。
只需阅读这篇文章。
Sticky Footer and Faux Columns
More information:
Read this. CSS(2, at least) really struggles with this problem. So a few of your options are:
repeat-y
to give the illusion of full length columnsAll of these have their benefits, and differing browser support.
Just read this article.