Boostrap移动菜单无法打开

时间:2016-11-04 10:35:19

标签: twitter-bootstrap twitter-bootstrap-3

我的引导菜单在移动设备上不起作用。我检了好几次,但看不出错误。一切看起来都不错,iddata-target都是正确的。

  <div class="navbar navbar-default">
    <div class="container-fluid">
        <div class="navbar-header">
            <button class="navbar-toggle collapsed" data-target="#main-header" data-toggle="collapse" type="button">
                <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="/home">
                <img alt="Brand" src="assets/img/logo.png">
            </a>
        </div>

        <div class="collapse navbar-collapse" id="#main-header">
            <ul class="nav navbar-nav">
                <li>
                    <a href="/demo">Demo1</a>
                </li>
                <li>
                    <a href="/demo">Demo1</a>
                </li>
            </ul>

            <ul class="nav navbar-nav navbar-right">
                <li>
                    <p class="navbar-text">
                        Welcome, M1 D1
                    </p>
                </li>               
            </ul>
        </div>
    </div>
</div>

DEMO

1 个答案:

答案 0 :(得分:1)

更改菜单ID

id="#main-header"

id="main-header"