桌面屏幕的Bootstrap导航栏中缺少链接

时间:2016-05-17 23:21:50

标签: html css twitter-bootstrap

我试图按照引导程序3的示例进行操作,但我的导航栏问题似乎无法解决。使用以下html,当视口很薄(移动样式)时,导航栏项目在切换菜单中按预期显示,但当扩展到合理的桌面宽度时,导航栏链接("示例左1", "示例左2"和"示例右1"在下面的html中)全部完全消失。我遗漏了什么让他们消失了?

    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="utf-8">
            <meta http-equiv="X-UA-Compatible" content="IE=edge">
            <meta name="viewport" content="width=device-width, initial-scale=1">
            <title>Server</title>
            <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
            <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css">
        </head>
        <body>
            <nav class="navbar navbar-default">
                <div class="container">
                    <div class="navbar-header">
                        <button type="button" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar" class="navbar-toggle collapsed">
                            <span class="sr-only">Toggle navigation</span>
                            <span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span>
                        </button><a href="#" class="navbar-brand">Server</a>
                    </div>
                    <div id="navbar" class="navbar-collpase collapse">
                        <ul class="nav navbar-nav">
                            <li><a href="#">Example left 1</a></li>
                            <li><a href="#">Example left 2</a></li>
                        </ul>
                        <ul class="nav navbar-nav navbar-right">
                            <li><a href="#">Example right 1</a></li>
                        </ul>
                    </div>
                </div>
            </nav>
            <div class="container body-content">
                <h1>Welcome</h1>
            </div>
            <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
            <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
        </body>
    </html>

1 个答案:

答案 0 :(得分:1)

这里看起来你拼错了崩溃:<div id="navbar" class="navbar-collpase collapse">