当我在大屏幕上运行时,它看起来像这样: Dropdown Menu
。我想在“链接”菜单下打开下拉列表:
这是小屏幕Dropdown Menu2的外观。
如何使用引导程序解决此问题?这是我的代码:
<nav class="navbar navbar-expand-md navbar-light bg-light">
<a class="navbar-brand" href="#"><img src="../assets/logo.png" alt="" width="100px"></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarText" aria-controls="navbarText" aria-expanded="true" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarText">
<ul class="nav navbar-nav">
<li class="active"><a class="nav-link" href="#">Home</a></li>
<li class="active">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#">Link<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
</ul>
</li>
</ul>
</div>
</nav>