使用flex属性做一个粘性页脚

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>粘性页脚测试</title>
  <style>
    .Site {
      display: flex;
      min-height: 90vh;
      flex-direction: column;
    }
    .Site-content {
      flex: 1;
    }
  </style>
</head>


<body class="Site">
  <header>头部</header>
  <main class="Site-content">
  </main>
  <footer>页脚</footer>
</body>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/t1753867136/article/details/80226325
今日推荐