经典粘连布局:有一块内容
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
<title>Title</title>
<link rel="stylesheet" href="font/style.css">
<style type="text/css">
* {
margin: 0;
padding: 0;
}
html, body {
height: 100%;
}
#wrap {
min-height: 100%;
background-color: aliceblue;
}
#wrap .main {
padding-bottom: 50px;
}
#footer {
height: 50px;
background-color: dodgerblue;
text-align: center;
line-height: 50px;
margin-top: -50px;
}
</style>
</head>
<body>
<div id="wrap">
<div class="main">
main <br>
main <br>
main <br>
main <br>
main <br>
main <br>
</div>
</div>
<div id="footer">
footer
</div>
</body>
</html>
原文:https://www.cnblogs.com/kanaliya/p/12288508.html