【问题标题】:Absolute Footer not sticking to bottom of page, mobile绝对页脚不粘在页面底部,移动设备
【发布时间】:2018-04-07 09:39:51
【问题描述】:

好的,所以我查看了该网站上有关粘性页脚的其他一些问题,并尝试了很多问题以使它们在移动设备上工作,但无济于事(台式机很好)。我在我的网站上运行 buddypress,因此 html 是通过它生成的,这就是它目前的样子。我添加了绿色背景以使其更清晰。

Mobile Image

这是我的 buddypress 容器和页脚的 CSS。容器和页脚有绝对定位,而里面的 div(header、nav 和 body)都是相对的。

#buddypress{
  width:100%; /* Add this */
  height:100%;
  max-width: 480px;
  top:0;
  left:0;
  position: absolute;
  margin-bottom: 100px;
  background:black;
  color:white;
}
.x-colophon.bottom {
  height: 100px;
  background: green;
  bottom: 0;
  position: absolute;
}

#buddypress #item-header{
background-color: rgba(49,175,145,1);
border: none;
width: 100%;
left: 0;
right: 0;
position: relative;

}

#item-nav {
background-color: white;
font-size: 16px;
width: 100%;
position: relative;
}

#item-body {
background-color: white;
color: black;
width: 100%;
position: relative;
}

【问题讨论】:

  • 为我们展示一个演示

标签: html css mobile footer


【解决方案1】:

在你的页脚试试这个 -

.footer {
        position: relative;
        bottom:  -500px; // you can adjust the negative value
    }

【讨论】:

    猜你喜欢
    • 2012-10-19
    • 1970-01-01
    • 2013-07-27
    • 2020-04-04
    • 2014-06-16
    • 2016-05-01
    • 2011-06-30
    相关资源
    最近更新 更多