一、sticky footer布局
在页面布局时,内容很少的时候,提交按钮在页面的底部,当页面内容很多的时候,提交按钮在内容的底部
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
html,body,div,h1,p{margin:0; padding: 0;}
.detail{
position:fixed;
overflow:auto;
width:100%;
height:100%;
}
.wrapper{
min-height:calc(100% - 200px);
width:100%;
padding-bottom: 200px;
}
.wrapper p{
line-height: 120px;
font-size: 58px;
}
.footer{
width:100%;
height:150px;
background:blue;
margin:-150px auto 0 auto;
font-size:32px;
color:#fff;
text-align: center;
font-size:40px;
line-height: 150px;
}
</style>
</head>
<body>
<div class="detail">
<div class="wrapper">
<p>这里是main content区域..1.</p>
<p>这里是main content区域..2.</p>
<p>这里是main content区域..3.</p>
<p>这里是main content区域..5.</p>
<p>这里是main content区域..6.</p>
<p>这里是main content区域..7.</p>
<p>这里是main content区域..8.</p>
<p>这里是main content区域..9.</p>
</div>
<div class="footer">底部按钮</div>
</div>
</body>
</html>