简体   繁体   English

定位页脚问题

[英]Trouble with positioning footer

So, for a long time I thought my footer was working properly (sitting at the bottom of the page), but when I slide down and there's content that goes under the footer, something like this happens https://imgur.com/a/IZPtjIx所以,很长一段时间我都认为我的页脚工作正常(位于页面底部),但是当我向下滑动并且页脚下方有内容时,会发生这样的事情https://imgur.com/a /IZPtjIx

It sits where it was and doesn't want to go down.它就在原地,不想倒下。 Basically the footer doesn't go down as wrapper expands.基本上页脚不会随着包装器的扩展而下降。 I tried approching this a few times, for example applying overflow: hidden to wrapper, placing footer outside the wrapper, trying to set it with margin, but none of these options helped.我尝试了几次,例如应用溢出:隐藏到包装器,将页脚放在包装器外面,尝试用边距设置它,但这些选项都没有帮助。 Honestly, I have no idea what I'm doing wrong.老实说,我不知道我做错了什么。

Code that might help (I deleted colours etc to make it more clear)
.footer{
    display: flex;
    position: absolute;
    bottom: 0;
    width: 100%;
    z-index: 1000;
}
body{
    margin: 0px !important;
    height: 100%;
}
.wrapper{
    min-width: 100%;
    min-height: 100%;
    margin: 0;
}

Wrapper is around all my code (starting before nav and ending after footer).包装器围绕着我的所有代码(从导航之前开始,在页脚之后结束)。 Also- placing footer not in wrapper helped, but then it isn't visible after loading the page- I have to slide down to see it.另外 - 将页脚放置在包装器中没有帮助,但是在加载页面后它不可见 - 我必须向下滑动才能看到它。

答案是如此微不足道,我发现自己很尴尬 - 将边距底部放在包装纸上有所帮助。

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

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