gpt4 book ai didi

html - Bootstrap 3 Navbar 有 3 列。左边是 Logo ,中间是菜单,右边是社交图标

转载 作者:行者123 更新时间:2023-11-28 10:33:36 25 4
gpt4 key购买 nike

默认引导导航栏似乎无法生成这种导航栏。

分别是左、中、右。

当我想将菜单居中时,问题就来了。左右导航栏对我来说应该没问题。

我在 stackoverflow 中尝试了一些示例,菜单居中但它会将导航栏向右推到底部。

请问我该怎么办?

附上截图:-

enter image description here

我想将菜单居中放置在右侧的品牌(红框)和社交图标之间。

请在下面找到我的 jsfiddle :-

http://jsfiddle.net/t5644/3/

下面是我的代码:-

.navbar-default {
background-color: white;
border-color: white;
margin: 0; }
.navbar-default .navbar-brand {
color: black;
padding-left: 35px; }
.navbar-default .navbar-brand:hover, .navbar-default .navbar-brand:focus {
color: black; }
.navbar-default .navbar-text {
color: black; }
.navbar-default .navbar-nav > li > a {
font-family: "FuturaStd-Light";
font-size: 13px;
line-height: 40px;
color: black; }
.navbar-default .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li > a:focus {
color: black; }
.navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus {
color: black;
background-color: white; }
.navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:hover, .navbar-default .navbar-nav > .open > a:focus {
color: black;
background-color: white; }
.navbar-default .navbar-toggle {
border-color: white; }
.navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:focus {
background-color: white; }
.navbar-default .navbar-toggle .icon-bar {
background-color: black; }
.navbar-default .navbar-collapse,
.navbar-default .navbar-form {
border: none; }
.navbar-default .navbar-link {
color: black; }
.navbar-default .navbar-link:hover {
color: black; }
.navbar-default .navbar-right {
padding-right: 35px; }
.navbar-default .navbar-right .icon {
color: #c1c0c0;
font-size: 18px;
margin-left: 30px;
padding-top: 25px; }
.navbar-default .dropdown-menu > li > a {
font-family: "FuturaStd-Light";
font-size: 13px;
padding: 15px; }
.navbar-default .navbar-center {
margin: 0 auto; }

@media (min-width: 768px) {
.navbar-nav > li > .dropdown-menu {
margin-top: -10px; }

.dropdown-menu-bar {
height: 5px;
background: #ff6319;
margin-top: -25px;
box-shadow: none !important; } }
@media (max-width: 767px) {
.navbar-default {
margin-bottom: 20px; }

.navbar-default .navbar-nav .open .dropdown-menu > li > a {
color: black; }
.navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
color: black; }
.navbar-default .navbar-nav .open .dropdown-menu > .active > a, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
color: black;
background-color: white; }

<nav role="navigation" class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" data-toggle="collapse" data-target="#ricecomms-nav" class="navbar-toggle">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar">&nbsp;</span>
<span class="icon-bar">&nbsp;</span>
<span class="icon-bar">&nbsp;</span>
</button>
<a href="#" class="navbar-brand">
<img src="/media/img/header-logo.png" />
</a>
</div>

<div class="collapse navbar-collapse" id="ricecomms-nav">
<ul class="nav navbar-nav">
<li class="active">
<a href="#">ABOUT US</a>
</li>
<li class="dropdown">
<a href="#" data-toggle="dropdown" class="dropdown-toggle">INDUSTRIES</a>
<ul class="dropdown-menu">
<div class="dropdown-menu-triangle hidden-xs">
&nbsp;
</div>
<div class="dropdown-menu-bar hidden-xs">&nbsp;</div>
<li>
<a href="#">Technology</a>
</li>
<li>
<a href="#">Corporate</a>
</li>
<li>
<a href="#">Consumer</a>
</li>
<li>
<a href="#">Professional Services</a>
</li>
</ul>
</li>
<li>
<a href="#">SERVICES</a>
</li>
<li>
<a href="#">INSIGHTS</a>
</li>
<li>
<a href="#">CAREERS</a>
</li>
<li>
<a href="#">CONTACT US</a>
</li>
</ul>

<ul class="nav navbar-nav navbar-right">
<li>
<i class="icon ion-social-facebook">&nbsp;</i>
</li>
<li>
<i class="icon ion-social-twitter">&nbsp;</i>
</li>
<li>
<i class="icon ion-social-linkedin">&nbsp;</i>
</li>
</ul>
</div>
</div>
</nav>

最佳答案

对我有用

.navbar-nav {
float: left;
margin: 0;
margin-left: 40%;
}

.navbar-nav.navbar-right:last-child {
margin-right: -15px;
margin-left: 0;
}

margin-left 针对每种情况进行调整,有关更多信息,请访问 Bootstrap 3: Align navigation to center

关于html - Bootstrap 3 Navbar 有 3 列。左边是 Logo ,中间是菜单,右边是社交图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23428971/

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