gpt4 book ai didi

html - 为什么我的 Bootstrap 导航栏不会崩溃?

转载 作者:行者123 更新时间:2023-11-28 08:15:26 25 4
gpt4 key购买 nike

我正在尝试编写我团队网站的代码。导航栏不会在移动屏幕上折叠。我添加了“数据目标”来定位列表中的类。单击该按钮时,列表应该折叠,但实际上并没有。

<!-- Navbar -->

<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="/Home">Team 3774</a>
</div>
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navHeaderCollapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse navHeaderCollapse" style="height: 0.866667px;">
<ul class="nav navbar-nav">
<li><a href="/Team Bio">Team Bio</a></li>
<li><a href="/Our Coach">Our Coach</a></li>
<li><a href="/Gallery">Gallery</a></li>
<li><a href="/Outreach">Outreach</a></li>
<li><a href="/Youtube">Youtube</a></li>
</ul>
</div>
</div>
</div>

最佳答案

试试这个:

<div class="navbar navbar-inverse navbar-fixed-top" role="banner">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navHeaderCollapse">
<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">Team 3774</a>
</div>
<div class="collapse navbar-collapse navHeaderCollapse" role="navigation">
<ul class="nav navbar-nav">
<li><a href="/Team Bio">Team Bio</a></li>
<li><a href="/Our Coach">Our Coach</a></li>
<li><a href="/Gallery">Gallery</a></li>
<li><a href="/Outreach">Outreach</a></li>
<li><a href="/Youtube">Youtube</a></li>
</ul>
</div>
</div>
</div>

关于html - 为什么我的 Bootstrap 导航栏不会崩溃?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29020719/

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