gpt4 book ai didi

css - 导航栏切换未出现

转载 作者:太空宇宙 更新时间:2023-11-04 12:22:45 24 4
gpt4 key购买 nike

当我调整浏览器(IE 和 Chrome)大小时,导航会正确消失,但切换按钮不会出现。我遵循了 bootstrap 网站上的代码,但我不确定我遗漏了什么。先感谢您。这是我的代码片段:

<nav class="navbar navbar-default navbar-static-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#menu-collapse">
<span class="glyphicon glyphicon-menu-hamburger"></span>
<span class="glyphicon glyphicon-menu-hamburger"></span>
<span class="glyphicon glyphicon-menu-hamburger"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="menu-collapse">
<ul class="nav navbar-nav">
<li><a href="#">Home</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Projects</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
</div>
</nav>

最佳答案

您的代码看起来很棒,如果删除折叠类并将数据目标属性菜单折叠 ID 更改为一个类,我唯一​​会做的不同。我在这里重建了导航:

[http://www.bootply.com/xcsJFk9jpA][1]
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<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="site-template.html">Site Brand</a>
</div>

<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="index.html">Home</a></li>
<li><a href="blog.html">Blog</a></li>
<li><a href="clients.html">Clients</a></li>
<li><a href=" contact.html">Contact</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Social <b class="caret"></b></a><!--This link dose not go anywhere it is like the intro to the dropdown list.It is used to power the drop down menu. There are going to be social links in the drop down. -->
<ul class="dropdown-menu">
<li><a href="http://facebook.com">Facebook</a></li>
<li><a href="http://twitter.com">Twitter</a></li>
<li><a href="http://plus.google.com">Google</a></li>
<li><a href="http://www.linkedin.com">LinkedIn</a></li>
</ul>
</li>
</ul>
</div>
</nav>
<!-- End Navigation -->

关于css - 导航栏切换未出现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28245625/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com