2017-09-26 104 views
-4

我有内容隐藏页脚背后的问题。我看到,如果我从固定继承改变位置,它会有所帮助,但页脚将位于页面的底部。我希望始终看到页脚,并且只能滚动正文内容。粘页脚涵盖内容

我们使用AngularJS和Bootstrap

image explaining my problem

+1

您是Kingsman或NSA的一部分吗? –

+1

_“首先,我不能共享任何代码,因为这是一个‘秘密’项目” _ - 所以你的选择是,要么你解决它在内部和“秘密”为好;或者您提供[mcve] - 必要时将内容匿名化。 (或者,当然了,你可以去雇人,将签署一份保密协议...) – CBroe

+0

不要忘了,你使用的是什么是自由和开放源码..所以没有什么秘诀显示HTML/CSS代码 –

回答

0

你必须让你的身体xmargin-bottom像素,其中x是页脚(或多或少)的高度。

+0

更好地利用'浸轧bottom',而不是'保证金bottom',当你正在设置任何背景,内容/体。 –

0

尝试设置你粘页脚的高度padding-bottom最后的内容DIV,这有助于展现您的内容。检查下面的代码片段以供参考。

.last-content{ 
 
    margin-top:500px; 
 
    padding-bottom: 50px; 
 
} 
 
.footer{ 
 
    position:fixed; 
 
    bottom:0; 
 
    width:100%; 
 
    height:50px; 
 
    text-align: center; 
 
    background-color:#ccc; 
 
}
<div class="parent"> 
 
    <div class="content">Some content goes here 
 
    <div class="last-content"> 
 
     you last content 
 
    </div> 
 
    </div> 
 
    <div class="footer"> 
 
    sticky footer 
 
    </div> 
 
</div>

0

首先,测量你的身高页脚。 然后是页脚高度padding-bottom添加到您的身体。 假设您的页脚的高度为100像素,然后添加以下内容:

body{ 
    padding-bottom:100px; 
} 

或者你也可以添加空白格到你页面的底部将含有相同的页脚高度。