bootstrap 3响应式导航栏不会在移动浏览器上折叠,但可以与桌面浏览器一起使用

时间:2014-05-02 17:45:23

标签: javascript html css visual-studio-2012 twitter-bootstrap-3

我建立的网站在桌面浏览器上看起来很不错,但在移动设备上,导航栏并未针对移动设备进行优化。内联的页面列表保持在更大的屏幕上,并且导航切换显示在品牌的右侧。不确定是什么问题,但这是我的代码:

<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="../Content/bootstrap.css" rel="stylesheet" />
</head>

        <nav class="navbar navbar-default" id="navbar" role="navigation">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#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>
                    <a class="navbar-brand" href="/Home.aspx">
                        <img src="" class="img-responsive" alt="logo" />
                    </a>
                </div>
                <div class="collapse navbar-collapse" id="navbar-collapse-1">
                    <ul class="nav navbar-nav">
                        <li><a href="../Home.aspx">Home</a></li>
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">Products & Services <b class="caret"></b></a>
                            <ul class="dropdown-menu">
                                <li><a tabindex="-1" href="">Workflow</a></li>
                                <li><a tabindex="-1" href="">Sys</a></li>
                                <li></li>
                                <li class="dropdown-submenu"><a tabindex="-1" href="#">App</a>
                                    <ul class="dropdown-menu">
                                        <li><a tabindex="-1" href="">Overview</a></li>
                                        <li><a tabindex="-1" href="">Pricing</a></li>
                                        <li><a tabindex="-1" href="">Demo</a></li>
                                    </ul>
                                </li>
                            </ul>
                        </li>
                        <li><a href="">Contact</a></li>
                    </ul>
                </div>
            </nav>

如果有人能为我发光,我会很感激。

0 个答案:

没有答案