[html] 写个布局,当页面高度不够时,底部固定在下面,反之不固定

<div class="layout"> 
    <header class="header">
     <!-- header 内容 …… -->
    </header>
    <div class="page">
      <slot />
    </div>
    <footer class="footer">
      <!-- footer 内容 …… -->
    </footer>
</div>

.layout {
  position: relative;
  min-height: 100%;
}
.page {
  padding-bottom: 45px;
}
.footer {
  color: #c5c5c5;
  position: absolute;
  bottom: 20px;
  height: 25px;
}

个人简介

我是歌谣,欢迎和大家一起交流前后端知识。放弃很容易,
但坚持一定很酷。欢迎大家一起讨论

主目录

与歌谣一起通关前端面试题