flex三段布局

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style type="text/css">
        body {
          display: flex;
          min-height: 100vh;
          flex-direction: column;
        }

        .content {
          flex: 1;
        }
    </style>
</head>
<body>
  <header>head</header>
  <main class="content">main</main>
  <footer>footer</footer>
</body>
</body>
</html>

推荐阅读更多精彩内容