如何将Bootstrap Burger菜单功能添加到常规Bootsrap菜单?

时间:2018-09-27 18:17:38

标签: javascript html css navigation

此菜单需要成为宽度为992px及以下分辨率的Bootstrap汉堡菜单。

我正在使用Bootstrap 3。

<div class="container-fluid">
        <div class="row navbar">
            <div class="col-sm-2 col-sm-offset-1"><a class="btn" href="index.html">Home</a></div>
            <div class="col-sm-2"><a class="btn" href="prices.html">Our Prices</a></div>
            <div class="col-sm-2"><a class="btn" href="location.html">Location</a></div>
            <div class="col-sm-2"><a class="btn" href="about.html">About Us</a></div>
            <div class="col-sm-2"><a class="btn" href="contact.html">Contact Us</a></div>
        </div>
    </div>

1 个答案:

答案 0 :(得分:0)

我认为这就是您要寻找的

<nav class="navbar navbar-inverse navbar-static-top" role="navigation">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
            </div>

            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav">
                    <li><a class="btn" href="index.html">Home</a></li>
                    <li><a class="btn" href="prices.html">Our Prices</a></li>
                    <li><a class="btn" href="location.html">Location</a></li>
                    <li><a class="btn" href="about.html">About Us</a></li>
                    <li><a class="btn" href="contact.html">Contact Us</a></li>
                </ul>
            </div>
        </div>
    </nav>