gpt4 book ai didi

html - Dropup Bootstrap (v3.3.7) 固定在底部时切换菜单

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

我有一个固定在底部的菜单,并希望切换为下拉而不是向下。我已经尝试了在 stackoverflow 中找到的所有解决方案(比如这个 How to get a Bootstrap dropdown submenu to 'dropup' ),用 .dropup 类结束,或者将它添加到元素等等,但没有任何效果。这是我的代码:

编辑以添加 URL: http://linares.kmturismo.com/

编辑 2 - 指出错误:一个是在另一个答案中指出的。此外,我通过自定义 css 类给了它 height: 50px;,这阻止了菜单的下拉。

      <nav class="navbar navbar-default navbar-fixed-bottom">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<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="#">Linares de Mora</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="#about">Que Hacer</a></li>
<li><a href="#contact">Alojamiento</a></li>
<li><a href="#contact">Historia</a></li>
<li><a href="#contact">Comida</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Más <span class="caret"></span></a>

<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li role="separator" class="divider"></li>
<li class="dropdown-header">Nav header</li>
<li><a href="#">Separated link</a></li>
<li><a href="#">One more separated link</a></li>
</ul>

</li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>

最佳答案

检查此链接 https://jsfiddle.net/edz80vw5/

<nav class="navbar navbar-default navbar-fixed-bottom">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<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="#">Linares de Mora</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="#about">Que Hacer</a></li>
<li><a href="#contact">Alojamiento</a></li>
<li><a href="#contact">Historia</a></li>
<li><a href="#contact">Comida</a></li>
<li class="dropup">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Más <span class="caret"></span></a>

<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li role="separator" class="divider"></li>
<li class="dropdown-header">Nav header</li>
<li><a href="#">Separated link</a></li>
<li><a href="#">One more separated link</a></li>
</ul>

</li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>

区别在于第一个 ul 的最后一个 li 元素具有类 dropup 而不是 dropdown .

关于html - Dropup Bootstrap (v3.3.7) 固定在底部时切换菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39952870/

24 4 0