【问题标题】:Footer-bar won't go at bottom of page [duplicate]页脚栏不会出现在页面底部[重复]
【发布时间】:2017-02-07 18:00:24
【问题描述】:

我现在什么都试过了。我的页脚栏一直停留在页面中间或固定在屏幕底部。无论我在网站上放多少内容,我都需要它在页面底部。

#footer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: #000000;
}
<div id="footer">

</div>

【问题讨论】:

    标签: html css footer


    【解决方案1】:

    使用底部:自动,而不是'0'

    #footer {
    position: absolute;
    right: 0;
    bottom: auto;
    left: 0;
    width:100%;
    height:60px;
    background:#000000;
    }
    content <br>Content<br>Content
    <div id="footer">
    
    </div>

    【讨论】:

    • 仍然在页面中间。
    • 如果您只想让页脚跟随您的内容,然后删除所有属性positionrightleftbottom
    • 没有任何作用。
    猜你喜欢
    • 2021-05-30
    • 2020-10-03
    • 1970-01-01
    • 2016-02-25
    • 2015-05-09
    • 2020-04-04
    • 2014-11-17
    • 2018-08-11
    • 2020-03-22
    相关资源
    最近更新 更多