gpt4 book ai didi

html - Bootstrap 导航栏按钮未显示

转载 作者:行者123 更新时间:2023-11-28 07:52:06 27 4
gpt4 key购买 nike

我试图让我的 Bootstrap 导航栏响应,当浏览器缩小到手机大小时,导航栏会缩小并隐藏所有内容,但导航按钮不会显示。有人可以看看我的代码,看看我做错了什么吗?一切似乎都很好。感谢您查看。

<nav class="navbar navbar-default navbar-inverse" id="navpad">
<!-- Navbar -->
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapse" data-toggle="collapse" data-target=".nav-collapse #bs-example-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 href="#" class="navbar-brand">IC</a> <!-- Brand -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<!-- Links -->
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home<span class="sr-only">(Current)</span></a></li>
<li><a href="#">Nosotros</a></li>
<li class="dropdown">
<!-- Dropdown -->
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
aria-expanded="false">Ministerios<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="#">Ministerio 1</a></li>
<li><a href="#">Ministerio 2</a></li>
<li><a href="#">Ministerio 3</a></li>
<li><a href="#">Ministerio 4</a></li>
<li><a href="#">Ministerio 5</a></li>
</ul>
</li>
<!-- /Dropdown -->
<li><a href="#">Servicios</a></li>
<li><a href="#">Miembros</a></li>
<li><a href="#">Contacto</a></li>
</ul>
</div>
<!-- /Navbar Collapse -->
</div>
<!-- /Navbar Header -->
</div>
<!-- /Container-fluid -->
</nav>
<!-- /Navbar -->

最佳答案

从导航栏切换中移除collapse,并设置正确的数据目标..

<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle Navigation</span>
...

http://codeply.com/go/3kSRfMNfmj

关于html - Bootstrap 导航栏按钮未显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30335634/

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