简体   繁体   English

移动页面的绝对页脚不固定

[英]Absolute Footer not sticking to bottom of page, mobile

Okay so i have looked at a bunch of the other questions on this site regarding sticky footers and have tried heaps of them to get them working on mobile but to no avail (desktop is fine). 好的,所以我查看了本网站上有关粘性页脚的其他问题,并尝试了其中的许多内容以使它们在移动设备上工作,但无济于事(台式机很好)。 I am running buddypress on my site so the html is generated through that, here is what it looks like at the moment. 我在我的网站上运行buddypress,因此html就是通过它生成的,这是当前的样子。 I added a green background to make it more clear. 我添加了绿色背景以使其更加清晰。

Mobile Image 手机图片

Here is my css for the buddypress container and footer. 这是我的buddypress容器和页脚的CSS。 There is absolute positioning on the container and footer while the divs inside (header, nav, and body) are all relative. 容器和页脚上的绝对位置是绝对的,而内部的div(页眉,导航和正文)都是相对的。

#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;
}

Try this on your footer - 在页脚上尝试一下-

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM