我需要制作一个布局,其中包含一个高度固定(例如100px)且宽度为100%的 .header
和 .content
。
然后,我需要放置一个动态高度的内容,以填充空白区域。
<!-- [...] -->
<style type="text/css">
body {
margin: 0;
padding: 0;
}
.wrapper {
height: 100%;
width: 100%;
position: absolute;
}
.header {
position: absolute;
top: 0;
height: 100px;
width: 100%;
background: #0F0;
}
.footer {
position: absolute;
bottom: 0;
height: 100px;
width: 100%;
background: #0F0;
}
.content {
position: absolute;
height: 100%;
width: 100%;
background: #F00;
padding: 100px 0;
margin: -100px 0;
}
</style>
</head>
<body>
<div class="wrapper">
<div class="header">
</div>
<div class="content">
</div>
<div class="footer">
</div>
</div>
</body>
</html>
中)。
.content
填充在.header
和.footer
之间的空间吗? - jackJoe.content
还是在html
中? - buschtoens