<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>移动端自适应布局</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html,
body {
height: 100%;
}
body {
display: flex;
flex-direction: column;
min-height: 100vh;
}
.header {
background-color: #f0f0f0;
padding: 15px;
}
.content {
flex: 1;
padding: 15px;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
.footer {
background-color: #333;
color: white;
padding: 15px;
}
</style>
</head>
<body>
<header class="header">
<h1>头部内容</h1>
</header>
<main class="content">
<p>这里是页面主体内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...</p>
<p>更多内容...aaaa</p>
</main>
<footer class="footer">
<p>底部自适应内容</p>
</footer>
</body>
</html>
