html - 如何使页脚对齐到最底部?

标签 html css alignment footer

我是 CSS 新手,查了很多方法,但无法让页脚与底部对齐。有什么帮助吗?谢谢。

.footer {
    position: bottom;
    bottom: -10px;
    height: 30px;
    width: 100%;
    background-color: #171717;
    color: white;
}

最佳答案

将位置更改为固定。

.footer {
    position:fixed;
    bottom:0px;
    height:30px;
    width:100%;
    background-color:#171717;
    color:white;
}

关于html - 如何使页脚对齐到最底部?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12208977/

相关文章:

php - vertical column in table 在html表格中水平显示查询结果

php - 检查 SQL 数据库的值

javascript - 在html表中获取倒数第二个 child td

css - jQuery 切换事件状态

html - 具有像素和百分比宽度的 CSS 并排 div

Outlook 2013 中的 HTML 对齐关闭

css - <h2> 干扰内联 div 的垂直对齐

html - 大负边距以创建全长侧边栏

css - 背景透明不工作JavaFX

列表项的 CSS 多列布局在 Chrome 中未正确对齐