gpt4 book ai didi

html - Bootstrap 下拉菜单 - 全宽和中央水平元素

转载 作者:行者123 更新时间:2023-11-28 05:14:55 25 4
gpt4 key购买 nike

我下面的导航栏有一个下拉菜单,它显示了 <li> 的水平列表。元素

<ul class="dropdown-menu">

如何确保下拉菜单的行为与 div 容器类相同?即:屏幕全宽,元素集中?

@import 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css';

<nav class="navbar navbar-default">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="true">
<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-left" href="/home/"><span class="logo"></span></a>
</div>

<!-- Collect the nav links, forms, and other content for toggling -->
<div class="navbar-collapse collapse in" id="bs-example-navbar-collapse-1" aria-expanded="true" style="">
<ul class="nav navbar-nav navbar-right">

<li class="">
<a href="/opt1/">Option 1</a>
</li>
<li class="">
<a href="/opt2/">Option 2</a>
</li>
<li class="">
<a href="/opt3/">Option 3</a>
</li>
<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">More...<span class="caret"></span></a>
<ul class="dropdown-menu">
<li class="">
<a href="/drop1/">Dropdown 1</a>
</li>
<li class="">
<a href="/drop2r/">Dropdown 2</a>
</li>
<li class="">
<a href="/drop3/">Dropdown 3</a>
</li>
<li class="">
<a href="/drop4/">Dropdown 4</a>
</li>

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

最佳答案

看看Yamm Menu for Bootstrap ,这就是您所需要的。

关于html - Bootstrap 下拉菜单 - 全宽和中央水平元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39364830/

25 4 0