1、定位postion
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<title>首尾固定中间高度自适应</title>
<style>
html, body {
height: 100%;
margin: 0;
padding: 0
}
.head {
height:80px;
line-height:80px;
background: #690;
width: 100%;
position: absolute;
top: 0;
text-align: center;
}
.body {
background: #FC0;
width: 100%;
overflow: auto;
top: 80px;
position: absolute;
text-align: center;
bottom: 80px;
}
.foot {
height: 80px;
line-height: 80px;
background: #690;
width: 100%;
position: absolute;
bottom: 0;
text-align: center;
}
</style>
</head>
<body>
<div class="head">固定头部80px;</div>
<div class="body">
中间自适应<br>
中间自适应