gpt4 book ai didi

html - Bootstrap 3 - 如何在导航中获取标签栏

转载 作者:行者123 更新时间:2023-11-28 15:31:24 27 4
gpt4 key购买 nike

如何将 Bootstrap 标签栏放入页眉顶部栏? (见截图)Tabbar in header top bar

这是我现在的代码:

        <div 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-collapse">
<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="/">AppName</a>
</div>
<div class="navbar-collapse collapse">
<form method="post" id="logoutForm" class="navbar-right" action="/Account/LogOff">
<ul class="nav navbar-nav navbar-right" style="margin-right: 20px">
<li>
<a title="Manage" href="/Account/Claims">User</a>
</li>
<li>
<button type="submit" class="btn btn-link navbar-btn navbar-link">Log off</button>
</li>
</ul>
</form>
</div>
</div>
</div>

<ul class="nav nav-tabs">
<li><a href="/">Home</a></li>
<li class="active"><a href="#">Link A</a></li>
<li class=""><a href="#">Link B</a></li>
<li class=""><a href="#">Link C</a></li>
<li class=""><a href="#">Link D</a></li>
<li class=""><a href="/Admin">Admin</a></li>
</ul>

谢谢!

最佳答案

您必须将这段代码移到 navbar-header div 内的 navbar-brand 标签之后。

<ul class="nav nav-tabs">
<li><a href="/">Home</a></li>
<li class="active"><a href="#">Link A</a></li>
<li class=""><a href="#">Link B</a></li>
<li class=""><a href="#">Link C</a></li>
<li class=""><a href="#">Link D</a></li>
<li class=""><a href="/Admin">Admin</a></li>
</ul>

你的代码应该是这样的

       <div 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-collapse">
<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="/">AppName</a>
<ul class="nav nav-tabs">
<li><a href="/">Home</a></li>
<li class="active"><a href="#">Link A</a></li>
<li class=""><a href="#">Link B</a></li>
<li class=""><a href="#">Link C</a></li>
<li class=""><a href="#">Link D</a></li>
<li class=""><a href="/Admin">Admin</a></li>
</ul>
</div>
<div class="navbar-collapse collapse">
<form method="post" id="logoutForm" class="navbar-right" action="/Account/LogOff">
<ul class="nav navbar-nav navbar-right" style="margin-right: 20px">
<li>
<a title="Manage" href="/Account/Claims">User</a>
</li>
<li>
<button type="submit" class="btn btn-link navbar-btn navbar-link">Log off</button>
</li>
</ul>
</form>
</div>
</div>
</div>

关于html - Bootstrap 3 - 如何在导航中获取标签栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44655852/

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