gpt4 book ai didi

twitter-bootstrap - Bootstrap 4 导航栏,带有品牌中心和左侧、中心和右侧的链接

转载 作者:行者123 更新时间:2023-12-01 10:20:54 24 4
gpt4 key购买 nike

我想创建一个导航栏,其中品牌位于中心,链接位于中心、左侧和右侧。就像这个网站上使用的一样:https://www.clarks.es/

目前,我有下一个导航栏,但我还需要中心的链接。

<nav class="navbar navbar-dark navbar-expand-md bg-success justify-content-between">
<div class="container-fluid">

<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".dual-nav">
<span class="navbar-toggler-icon"></span>
</button>

<div class="navbar-collapse collapse dual-nav w-50 order-1 order-md-0">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
</ul>
</div>

<a href="/" class="navbar-brand mx-auto d-block text-center order-0 order-md-1 w-25">Brand</a>

<div class="navbar-collapse collapse dual-nav w-50 order-2">
<ul class="nav navbar-nav ml-auto">
<li class="nav-item"><a class="nav-link" href="">Link 1</a></li>
<li class="nav-item"><a class="nav-link" href="">Link 2</a></li>
</ul>
</div>

</div>
</nav>

最佳答案

这是我关于如何实现您想要的菜单的想法。请注意,边框类只是为了视觉测试而添加的,它们可以被删除。希望对您有所帮助。

<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>

<nav class="navbar navbar-dark navbar-expand-md bg-success">

<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".dual-nav">
<span class="navbar-toggler-icon"></span>
</button>

<div class="navbar-collapse collapse dual-nav order-1 order-md-0">
<ul class="navbar-nav border border-primary">
<li class="nav-item">
<a class="nav-link" href="#">Left Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Left Link</a>
</li>
</ul>
</div>

<div class="navbar-collapse collapse dual-nav order-2 order-md-1 justify-content-end">
<ul class="navbar-nav border border-danger">
<li class="nav-item">
<a class="nav-link" href="#">Center Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Center Link</a>
</li>
</ul>
</div>

<a href="/" class="navbar-brand mx-auto order-0 order-md-2 p-2">Brand</a>

<div class="navbar-collapse collapse dual-nav order-3 order-md-3">
<ul class="navbar-nav border border-danger">
<li class="nav-item">
<a class="nav-link" href="#">Center Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Center Link</a>
</li>
</ul>
</div>

<div class="navbar-collapse collapse dual-nav order-4 order-md-4 justify-content-end">
<ul class="navbar-nav border border-primary">
<li class="nav-item">
<a class="nav-link" href="#">Right Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Right Link</a>
</li>
</ul>
</div>

</nav>

这个 navbar 的结构主要使用 Bootstrap 4 中的下一个实用程序:

关于twitter-bootstrap - Bootstrap 4 导航栏,带有品牌中心和左侧、中心和右侧的链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52827350/

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