【发布时间】:2013-12-11 18:09:27
【问题描述】:
我为我的应用程序使用了引导菜单。它看起来像这样: 但是当我将窗口大小更改为更小时,它会消失 - 看起来像这样: 当它大约 965px 宽(所以它可能是 979px)时它会消失。我试过this solution,没用。可能我正在混合引导 2 和 3? 这是我的菜单代码:
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="/">Digrin</a>
<div class="nav-collapse collapse">
<ul class="nav">
{{ request.path }}
<li{% block nav_stocks %}{% endblock %}><a href="/stocks/">Stocks</a></li>
<li{% block nav_mystocks %}{% endblock %}>
<a href="/stocks/mystocks">My Portfolio</a></li>
<li{% block nav_watchstocks %}{% endblock %}>
<a href="/stocks/watchstocks">Watcher</a></li>
{% if not user.is_authenticated %}
<li class="active"><a href="/accounts/login/?next=/stocks/">Login</a></li>
<li><a href="/accounts/register/">Register</a></li>
{% else %}
<ul class="nav">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
{{ user.username }}
<i class="caret"></i>
</a>
<ul class="dropdown-menu">
<li><a href="/accounts/password/change/">Change password</a></li>
{% if user.is_staff %}<li><a href="/admin">Admin</a></li>{% endif %}
<li><a href="/accounts/logout/?next=/stocks/">Logout</a></li>
</ul>
</li>
</ul>
{% endif %}
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
包括:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Le styles -->
<link href="{% static "css/bootstrap.css" %}" rel="stylesheet">
<style>
body {
padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
}
</style>
<link href="{% static "css/bootstrap-responsive.css" %}" rel="stylesheet">
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script src="{% static "js/jquery-1.8.1.min.js" %}" type="text/javascript"></script>
<script src="{% static "js/bootstrap.min.js" %}" type="text/javascript"></script>
还有site(远未完成) 如果我放大,菜单也会消失。
【问题讨论】:
标签: css twitter-bootstrap collapse