我现在正在开发一个 Joomla 2.5 模板 @ http://development.aycdesign.net/skin,并且已经坚持了好几天了,谷歌在这个问题上也不是朋友。我想要完成的是拥有一个可变大小的页眉、可变大小的页脚,并且始终让内容容器至少为浏览器窗口大小的 100%。我已经尝试了几乎所有在阳光下的东西,但遇到了两个问题。
- 我的内容所在的容器不会扩展到其容器的 100% 高度。
- 在必须滚动的页面上,部分内容被剪裁到页脚中。
对此的任何建议将不胜感激,以便我可以解决这个问题并继续前进!
<html>
<body>
<div id="wrapper">
<div id="top">
header
</div>
<div id="mnav">
main menu
</div>
<div id="pagewidth">
<div id="maincol">
content
</div>
</div>
<div id="footer">
footer
</div>
</div>
</body>
</html>
....和CSS:
html,body {
height:100%;
background: rgb(138, 126, 102);
color: #A5A56F;
font-family: arial, sans-serif;
font-size: .9em;
line-height: 1.25;
}
/* ******************************************************************** */
/* Wireframe Elements */
/* ******************************************************************** */
#wrapper {
position: relative;
height:auto !important;
height:100%;
min-height:100%;
}
#top {
background: rgb(0, 0, 0);
width: 100%;
}
#top .custom {
width: 80%;
margin: 0 auto 0 auto;
color: #fff;
text-align: right;
padding: .5em 0 .5em;
}
#pagewidth {
width: 80%;
min-height: 100%;
background: rgba(54, 54, 54, 0.5);
text-align: left;
margin: 0 auto;
padding-bottom: 3em;
}
#maincol {
}
#footer {
background: rgb(0, 0, 0);
width: 100%;
height: 5%;
position: absolute;
bottom: 0;
}
#footer .custom {
width: 80%;
margin: 0 auto;
color: #fff;
text-align: right;
padding: .5em 0 .5em 0;
}