gpt4 book ai didi

html - Bootstrap 导航栏, Logo 在导航栏内居中

转载 作者:太空宇宙 更新时间:2023-11-04 09:27:17 29 4
gpt4 key购买 nike

Logo Centered Inside Navbar我尝试使用 Bootstrap 来实现它.. 但是我不想折叠logo部分,只折叠其他li。

<header role="banner">
<nav id="navbar-primary" class="navbar" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-primary-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="navbar-primary-collapse">
<ul class="nav navbar-nav">
<li><a href="#"><span class="glyphicon glyphicon-home"
aria-hidden="true"></span> Home</a></li>
<li style="margin-right: 80px"><a href="articles.html"><i class="fa fa-pagelines" aria-hidden="true"></i>
Articles</a></li>
<li style="margin-left: 80px"><a href="signIn.html"><i class="fa fa-sign-in" aria-hidden="true"></i>
Sign in</a></li>
<li class="active"><a href="signUp.html"><i class="fa fa-sign-in" aria-hidden="true"></i>
Sign up</a></li>
</ul>
</div>
<div style="float:none">
<a href="#"><img src="../image/uoblogo.png" height="60px" width="200px" ></a>
</div>
</div>
</nav>
</header>

最佳答案

这基本上是answered on SO before .您需要根据图像高度等调整 CSS,并使 navbar-brand 远离 navbar-collapse

.navbar-brand {
position: absolute;
width: 100%;
left: 0;
top: 0;
text-align: center;
margin: auto;
}
.navbar-brand > img {
display: initial;
}
.navbar-toggle {
z-index:3;
}

http://www.codeply.com/go/G5uYBjmKkf

关于html - Bootstrap 导航栏, Logo 在导航栏内居中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41002651/

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