小编lll*_*lll的帖子

Bootstrap粘性页脚重叠内容

我是Bootstrap的新手,我正在尝试将它与Symfony2一起使用.我已经有一个用于导航的主topbar sticky.我的问题是当我尝试在底部添加一个粘性的类似页脚,但它与我的内容重叠.我正在使用JQuery脚本来避免顶部导航栏的问题,如下所示:

$(document).ready(function(){
        $(document.body).css('padding-top', $('#topnavbar').height());
        $(window).resize(function(){
            $(document.body).css('padding-top', $('#topnavbar').height());
        });
    });
Run Code Online (Sandbox Code Playgroud)

我的主要Twig布局的结构如下:

    <div class="navbar navbar-default navbar-fixed-top" id="topnavbar">
      <div class="container-fluid">
      </div>
    </div>
    {% block body %}
    {% endblock %}
    <footer class="footer navbar-fixed-bottom">
    </footer>
Run Code Online (Sandbox Code Playgroud)

我的CSS是原创的.我试过margin bottom或者padding bottom但我的内容(在{%block body%}中)的重叠始终存在,我不知道该怎么做才能修复它.有没有人有想法?

html css twitter-bootstrap

15
推荐指数
3
解决办法
3万
查看次数

标签 统计

css ×1

html ×1

twitter-bootstrap ×1