我尝试使用此代码创建一个带导航栏内置徽标的自举导航,但我在页面右侧获得了额外的空间。 我想在导航栏后修复额外的空间。 使用此代码,页面滚动到右侧的空白区域,页面应该不适合导航栏。
@import url( 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css' );
.navbar {
text-transform: uppercase;
background-color: #27B6C9;
position: relative;
top: 0px;
font-size: 14px;
border-bottom: none;
margin-bottom: 0px;
padding: 0px 0px;
font-weight: 600;
}
.navbar-brand {
padding: 0 10px;
height: auto;
}
@media (min-width: 768px) {
.navbar-nav {
position: relative;
right: -50%;
}
.navbar-nav > li {
position: relative;
left: -50%;
}
.navbar-nav > li a {
line-height: 126px;
vertical-align: middle;
padding: 0 18px;
}
}
@media (min-width: 892px) {
.navbar-nav > li a {
padding: 0 30px;
}
}
@media (min-width: 1100px) {
.navbar-nav > li a {
padding: 0 40px;
}
}

<nav class="navbar navbar-default">
<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 hidden-sm hidden-md hidden-lg" href="#">
<img src="https://raw.githubusercontent.com/reactjs/redux/master/logo/logo.png" alt="WPO LOGO" width="80" />
</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="#about">About</a>
</li>
<li><a href="#services">Services</a>
</li>
<li><a href="#policies">Policies</a>
</li>
<li class="hidden-xs">
<a href="#">
<img src="https://raw.githubusercontent.com/reactjs/redux/master/logo/logo.png" alt="Brand" width="80" />
</a>
</li>
<li><a href="#calendar">Calendar</a>
</li>
<li><a href="#faq">FAQ</a>
</li>
<li><a href="#contact">Contact</a>
</li>
</ul>
</div>
</div>
</nav>
&#13;
答案 0 :(得分:0)
我添加新类mr0并将其添加到按钮导航栏
在css中复制此类并重新按下按钮
.mr0{
margin-right:0pxImportant;
}
<button type="button" class="navbar-toggle mr0" data-toggle="collapse"