我有 3 个 id 为 header
, content
和 footer
的 div。页眉和页脚具有固定的高度,它们的样式设置为浮动在顶部和底部。我想要中间 content
高度用jquery自动计算。我怎样才能做到这一点?
#header {
height: 35px;
width: 100%;
position: absolute;
top: 0px;
z-index: 2;
}
#footer {
height: 35px;
width: 100%;
position: absolute;
bottom: 0px;
z-index: 2;
}
在此先感谢… :)
布雷拉弗雷德
原文由 Alfred 发布,翻译遵循 CC BY-SA 4.0 许可协议
那么你可以这样做:
在这里看小提琴:http: //jsfiddle.net/maniator/JVKbR/
演示:http: //jsfiddle.net/maniator/JVKbR/show/