简单移动端,上下固定,中间自适应布局(直接用)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
body,html{
height:100% ;
}
body{
display: flex;
flex-direction: column;
}
.hearder{
height: 50px;
background-color: greenyellow;
}
.footer{
height: 50px;
background-color: hotpink;
}
.main{
background: lightskyblue;
flex: 1;
overflow: auto;
}
</style>
</head>
<body>
<div class="hearder"></div>
<div class="main">
</div>
<div class="footer"></div>
</body>
</html>