gpt4 book ai didi

html - Bootstrap 4 导航栏切换器在小屏幕上位于我的 Logo 之上

转载 作者:太空宇宙 更新时间:2023-11-03 22:41:25 25 4
gpt4 key购买 nike

我在小屏幕上遇到问题,我无法弄清楚为什么会这样。

这是一个演示:https://jsfiddle.net/7ww6ybpk/

代码如下:

<!-- main navigation -->
<nav class="navbar navbar-toggleable-md navbar-light">
<div class="container">
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#mainNav" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="">
<img class="img-fluid" src="https://twocan.co/public/images/shared/logos/logo-header.png" alt="Learn English with twocan.com" />
</a>

<div class="collapse navbar-collapse" id="mainNav">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="">
<i class="fa fa-home" aria-hidden="true"></i>
Foo
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="">
<i class="fa fa-certificate"></i>
Foo
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="">
<i class="fa fa-lightbulb-o"></i>
Foo
</a>
</li>
</ul>

<ul class="navbar-nav ml-auto">

<li class="nav-item">
<a class="nav-link" href="">
<i class="fa fa-sign-in"></i>
Foo
</a>
</li>
<span class="navbar-text">
/
</span>
<li class="nav-item">
<a class="nav-link" href="">
Foo
<i class="fa fa-check"></i>
</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- end main navigation -->

如您所见, Logo 位于汉堡包菜单下方...我该如何解决这个问题?

最佳答案

试试下面的代码。我已经在导航栏中指定了右侧元素,当它折叠时,所有内容都聚集在一起。我希望这就是你要找的。

   <nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="">
<img class="img-fluid" src="https://twocan.co/public/images/shared/logos/logo-header.png" alt="Learn English with twocan.com" /></a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Foo</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Foo Drop<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Foo 1 </a></li>
<li><a href="#">Foo 2</a></li>
<li><a href="#">Foo 3</a></li>
</ul>
</li>
<li><a href="#">Foo</a></li>
<li><a href="#">Foo</a></li>
</ul>

<!--Right Side-->
<ul class="nav navbar-nav navbar-right">
<li><a href="#">Foo R1 </a></li>
<li><a href="#">Foo R2</a></li>
</ul>
</div>
</div>
</nav>`enter code here`

关于html - Bootstrap 4 导航栏切换器在小屏幕上位于我的 Logo 之上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43824052/

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