这样的事情怎么样?
HTML
<div id="header">
<img src="logo.gif" alt="logo" />
<h1 class="tagline">Oh em gee</h1>
</div>
<div id="content">
<div id="content-offset">
<p>This will be 100% of the screen height, BUT the content offset will have a top pixel margin which allows for your header. Set this to the pixel value of your header height.</p>
</div>
</div>
CSS
body, html {
margin: 0; padding: 0;
height: 100%;
}
#header {
height: 120px;
position: fixed;
top: 0;
background: red;
width: 100%;
}
#content {
height: 100%;
position: absolute;
top: 0;
}
#content-offset {
margin-top: 120px;
background: aqua;
height: 100%;
width: 100%;
position: fixed;
overflow: auto;
}