简体   繁体   English

页面上的Twitter Bootstrap导航栏固定顶部重新定位

[英]Twitter Bootstrap navbar-fixed-top repositioning on page

I've gotten Bootstrap running on my site successfully but I'm trying to use the navbar-top-fixed functionality and whenever the page loads it pushes everything down about 20 pixels and I can't seem to diagnose why. 我已经成功在网站上运行了Bootstrap,但是我尝试使用navbar-top-fixed功能,并且每当页面加载时,Bootstrap都会将所有内容降低20像素左右,我似乎无法诊断出原因。

My code for the nav-bar is this: 我的导航栏代码是这样的:

    <div class="navbar navbar-fixed-top">
        <div class="navbar-inner">
            <div class="container protected">
                <ul class="nav pull-right nav-pills">
                    <li><a href="/account/login" id="customer_login_link">Login</a></li>
                    <li><a href="/cart"><i class="icon-shopping-cart icon-white"></i> View cart <span class="badge badge-warning">2</span></a></li>
                </ul>
            </div>
        </div>
    </div>

And the page at this link will load the page properly, and then when it loads the page it pushes it down like this screenshot . 并且此链接处的页面将正确加载该页面,然后在加载页面时将其像该屏幕截图一样向下推。

Has anyone seen this before or know any quick fixes? 有没有人看过此书或知道任何快速修复方法? I am customizing one of the nav-bars on the page using lessCSS. 我正在使用lessCSS自定义页面上的导航栏之一。

Please move the navbar markup in front of the "container" div. 请将导航栏标记移到“容器” div的前面。 The "container" class has this margin defined. “容器”类已定义此边距。

See here: http://postimage.org/image/nu5pv8tkz/ 看到这里: http : //postimage.org/image/nu5pv8tkz/

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

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