首页 > 解决方案 > 如何使页脚停留在滚动的末尾

问题描述

我有 html

    <head>

    </head>

     <body>

     </body>

     <footer>

      </footer>

现在我想要的是页脚留在页面的最后,用户应该滚动查看它。你能帮帮我吗?

我试过了 :

footer{
    position: fixed;
    bottom:-100px;
    height: 100px;
    left: 0;
    width:100%;
    text-align: center;
}

但是设置 height:100px 和 bottom:-100px 让它隐藏,而我希望用户能够向下滚动查看它

标签: css

解决方案


position: fixed; bottom: 0;为您的页脚添加样式


推荐阅读