将 header
/ footer
固定住。
<body>
<div class="header">header</div>
<div class="main">main</div>
<div class="footer">footer</div>
</body>
.header{
position: fixed;
top:0;
width: 100%;
height: 30px;
background-color: red;
}
.footer{
position: fixed;
bottom: 0;
width: 100%;
height: 30px;
background-color: red;
}
.main{
margin-top: 35px;
min-height: 1000px;
background-color: yellow;
}