在CodePen中单击时,折叠的导航栏按钮不会展开

时间:2016-01-10 15:08:08

标签: twitter-bootstrap

CodePen链接:http://codepen.io/mraduldubey/pen/OMmzYV?editors=100 这是导航栏的代码。此折叠按钮在w3cschools网站的Tryit Editor中展开,但未在CodePen中展开:

<nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container-fluid">
        <div class="navbar-header" >
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span> 
            </button>
            <a class="navbar-brand" href="#">Mradul Dubey</a>
        </div>
        <div class="collapse navbar-collapse" id="myNavbar">
            <ul class="nav navbar-nav navbar-right">
                <li class="active"><a href="#Home">Home</a></li>
                <li><a href="#About">About</a></li>
                <li><a href="#Portfolio">Portfolio</a></li> 
                <li><a href="#Contact">Contact</a></li> 
            </ul>
        </div>
    </div>
</nav>

1 个答案:

答案 0 :(得分:0)

您可能没有在代码中引用jquery,bootstrap.js和bootstrap.css。这是关于jsfiddle和codepen的代码......

JSFiddle
CodePen