实现CSS – 粘页脚

我遵循这里提到的步骤 – http://materializecss.com/footer.html – 创建一个粘页脚,但结果不如预期.

我将以下代码复制粘贴到materialize.min.css文件中:

body {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
  }

  main {
    flex: 1 0 auto;
  }

解决方法

您可能没有使用< main>标签

Note: We use flexBox to structure our html so that the footer is
always on the bottom of the page. It is important to keep the
structure of your page within the 3 HTML5 tags: <header>,<main>,
<footer>

相关文章

Css3如何实现鼠标移上变长特效?(图文+视频)
css3怎么实现鼠标悬停图片时缓慢变大效果?(图文+视频)
jquery如何实现点击网页回到顶部效果?(图文+视频)
css3边框阴影效果怎么做?(图文+视频)
css怎么实现圆角边框和圆形效果?(图文+视频教程)
Css3如何实现旋转移动动画特效