Liferay 6.2 中的粘性页脚

Sticky footer in Liferay 6.2

如何在 Liferay 中创建粘性页脚?我已经阅读了很多文档,但所有文档都没有用。

我在custom.css

中有这个
#footer {
     background-color: black;
     color: white; 
     font-size: 200%; 
     text-align: center; 
     line-height: 3em; 
     clear: both;
     position: relative; 
     z-index: 10; 
     height: 3em;
     margin-top: -3em;
}

以及 portal_normal.vm 中的这个:

<div id="footer">Powered by German</div>

在前面提到的问题中,我询问了如何创建页脚并更改其颜色。然后在评论里问了怎么创建sticky footer,没有得到很好的回答,所以我又创建了一个帖子。

好的,我的问题解决了!!!

首先,你应该看看这一行:<div class="container-fluid" id="wrapper"> in portlet_normal.vm:

我们的footer归入这一类,这样每次都不会在浏览器页面的末尾,而是在这个块的末尾。所以您需要关闭该块并将页脚放在下面:

<div id="footer" class="row-fluid">
    <div class="span12 text-center">
        <p class="powered-by">
            #language ("Powered by Alexandr Boldyrev")
        </p>
    </div>
</div>

然后,您应该在 custom.css 中更改页脚参数:

#footer {
     text-align: center;
     background: #FFEFD5;
     position: absolute;
     bottom: 0;
}

就这样,我们的页脚变粘了!