gpt4 book ai didi

javascript - 导航栏品牌左侧的按钮

转载 作者:太空狗 更新时间:2023-10-29 12:33:26 25 4
gpt4 key购买 nike

我试图在 navbar-brand 的左侧放置一个按钮来切换侧边栏。该按钮切换侧边栏。在桌面模式下,它工作正常,但在较小的屏幕上,它会改变位置并到达导航栏品牌的右侧。这是屏幕截图。

enter image description here

enter image description here

    <nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<button type="button" data-toggle="#sidebar" id="sidebar-toggle" class="navbar-left navbar-toggle">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="Login.aspx" style="vertical-align: middle">
<img src="Logo.png" style="vertical-align: middle" /></a>
<label class="navbar-text text-center text-primary" style="vertical-align:10px;font-size:medium">Example Distribution</label>
</div>
<div class="navbar-collapse collapse" id="navbar">
<ul class="nav navbar-nav navbar-right">
<li><a href="#">Dashboard</a></li>
<li><a href="#">Settings</a></li>
<li><a href="#">Profile</a></li>
<li><a href="#">Help</a></li>
</ul>
<form class="navbar-form navbar-right">
<input type="text" class="form-control" placeholder="Search..." />
</form>
</div>
</div>
</nav>
<div class="container-sidebar">
<div id="sidebar">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Explore</a></li>
<li><a href="#">Users</a></li>
<li><a href="#">Sign Out</a></li>
</ul>
</div>
</div>

最佳答案

只需添加这个 css 类 pull-left DEMO

  <button type="button" data-toggle="#sidebar" id="sidebar-toggle" class=" navbar-toggle pull-left">

关于javascript - 导航栏品牌左侧的按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30252387/

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