<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.header {
width: 100%;
position: absolute;
top: 0;
left: 0;
height: 80px;
max-height: 100px;
background-color:#000;
}
.footer {
width: 100%;
position: absolute;
bottom: 0;
left: 0;
height: 80px;
max-height: 100px;
background-color:#000;
}
.main {
width:100%;
overflow: auto;
position: fixed;
top: 80px;
bottom:80px;
background-color:#f00;
}
</style>
</head>
<body>
<div class="wrap">
<div class="header">header</div>
<div class="main">main
<div style="height: 2000px;"></div>
</div>
<div class="footer">footer</div>
</div>
</body>
</html>
上下固定,中间滚动布局
最新推荐文章于 2020-11-26 17:49:10 发布