twitter-bootstrap – Bootstrap 3 Navbar不会在移动浏览器上崩溃,但会在不足的桌面窗口中

前端之家收集整理的这篇文章主要介绍了twitter-bootstrap – Bootstrap 3 Navbar不会在移动浏览器上崩溃,但会在不足的桌面窗口中前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我的Rails 4站点与最新版本的引导不会在手机崩溃,但如果我在桌面上打开网站并缩小窗口,它将崩溃。以下是我的导航栏的代码
<div class = "navbar navbar-inverse navbar-static-top">
    <div class = "container">
        <a href = "/" class = "navbar-brand" style="color: white;">Earn And Learn</a>
        <button class = "navbar-toggle" data-toggle = "collapse" data-target = ".navHeaderCollapse">
            <span class = "icon-bar"></span>
            <span class = "icon-bar"></span>
            <span class = "icon-bar"></span>
        </button>
    <div class = "collapse navbar-collapse navHeaderCollapse">
            <ul class = "nav navbar-nav navbar-right">
            <li id="nav_ach"><a href = "/about/achievements" style="color: white;">Achievements</a></li>
            <li id="nav_faq"><a href = "/about/faq" style="color: white;">FAQ</a></li>
            <li id="nav_test"><a href = "/about/testimonials" style="color: white;">Testimonials</a></li>
            <li id="nav_news"><a href = "/about/news" style="color: white;">In the News</a></li>
                <li id="nav_steal"><a href = "/steal/index" style=" color: white;">Steal This Idea!</a></li>
                <li><a href = "#" data-toggle="modal" data-target="#myModal" style="color: white;">Contact Us</a></li>
            </ul>
    </div>
</div>
</div>

解决方法

通过github问题挖掘,结果我们错过了这一点
<Meta name="viewport" content="width=device-width,initial-scale=1.0">

http://getbootstrap.com/css/#overview-mobile

https://github.com/twbs/bootstrap/issues/10550

猜你在找的Bootstrap相关文章