是否可以使用Bootstrap始终将菜单折叠显示汉堡

时间:2018-04-13 12:59:04

标签: twitter-bootstrap

使用Bootstrap Nav是否可以始终将导航菜单显示为折叠,而不管浏览器的宽度如何,单击折叠的菜单汉堡时,菜单会在背景上下降但浏览器窗口的全宽?

<div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <h1 class="navbar-brand">
                    <a href="#"><i class="fa fa-2x fa-home"></i></a>
                </h1>
            </div>
            <nav class="collapse navbar-collapse navbar-right" role="navigation">
                <ul id="nav" class="nav navbar-nav">
                    <li><a href="#body">Home</a></li>
                    <li><a href="#about">About</a></li>
                    <li><a href="#gallery">Gallery</a></li>
                    <li><a href="#cost">Cost</a></li>
                </ul>
            </nav>
        </div>

0 个答案:

没有答案