CSS制作固定于页面底部的bar

最初发表于: 2019-08-20 09:17:19

代码如下

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    body {
      padding-bottom: 50px;
    }

    .footer {
      position: fixed;
      left: 0px;
      bottom: 0px;
      width: 100%;
      height: 50px;
      background-color: #eee;
      z-index: 9999;
    }
  </style>
</head>

<body>
  内容

  <div class="footer">固定在底部</div>
</body>

</html>