twitter bootstrap navbar fixed top overlapping site

后端 未结 18 2097
甜味超标
甜味超标 2020-11-22 11:59

I am using bootstrap on my site and am having issues with the navbar fixed top. When I am just using the regular navbar, everything is fine. However, when i try to switch it

18条回答
  •  面向向阳花
    2020-11-22 12:35

    Further to Nick Bisby's answer, if you get this problem using HAML in rails and you have applied Roberto Barros' fix here:

    I replaced the require in the "bootstrap_and_overrides.css" to:

    =require twitter-bootstrap-static/bootstrap.css.erb

    (See https://github.com/seyhunak/twitter-bootstrap-rails/issues/91)

    ... you need to put the body CSS before the require statement as follows:

    @import "twitter/bootstrap/bootstrap";
    body { padding-top: 40px; }
    @import "twitter/bootstrap/responsive";
    =require twitter-bootstrap-static/bootstrap.css.erb
    

    If the require statement is before the body CSS, it will not take effect.

提交回复
热议问题