gpt4 book ai didi

html - Bootstrap 4 折叠的导航栏

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

我正在尝试重新排列我用 Bootstrap 4 制作的折叠导航栏。它现在看起来像这样:

enter image description here

有没有一种方法可以将社交媒体按钮对齐在一条线上,将“关于”进一步向下并去掉“元素”和“联系人”前面的空格?

到目前为止,这是我的代码:

<nav class="navbar navbar-fixed-top navbar-light bg-faded">
<button class="navbar-toggler hidden-sm-up" type="button" data-toggle="collapse" data-target="#exCollapsingNavbar2" aria-controls="exCollapsingNavbar2" aria-expanded="false" aria-label="Toggle navigation">
&#9776;
</button>
<div class="collapse navbar-toggleable-xs" id="exCollapsingNavbar2">
<a class="navbar-brand" href="#">Timo Springer</a>
<ul class="nav navbar-nav m-x-auto" style="width: 300px;">
<li class="nav-item">
<a class="nav-link" href="#about">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#projects">Projects</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#contact">Contact</a>
</li>
</ul>
<ul class="nav navbar-nav pull-md-right">
<li class="nav-item">
<a class="nav-link" href="https://www.facebook.com/timo.springer"><i class="fa fa-facebook" aria-hidden="true"></i></a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://www.instagram.com/springertimo/?hl=en"><i class="fa fa-instagram" aria-hidden="true"></i></a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://500px.com/timospringer"><i class="fa fa-500px" aria-hidden="true"></i></a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://de.linkedin.com/in/timo-springer-372468129"><i class="fa fa-linkedin" aria-hidden="true"></i></a>
</li>

</ul>
</div>

非常感谢!

蒂莫

最佳答案

只需在 media css 的 nav 标签中添加 clear:both

@media (max-width:767px){
.nav.m-x-auto{
clear:both;
margin: 0 !important;
}
.nav.navbar-nav.pull-md-right li{
float:left;
}
.nav.navbar-nav.pull-md-right li + li{
margin-left: 1rem;
}
}

这里是 Demo

关于html - Bootstrap 4 折叠的导航栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40079512/

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