<!--NAVBAR-->
<nav class="navbar navbar-inverse">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Page 1</a></li>
<li><a href="#">Page 2</a></li>
<li class="navfixborder"><a href="#">Page 3</a></li>
</ul>
</div>
</div>
</nav>
我的CSS,css是基本的bootstrap,这是我编辑的唯一类。
.navbar-nav {
margin: 0;
text-align: center;
font-size: .9em;
width:100%;
font-weight: bold;
text-transform: uppercase;
font-family: Roboto, 'Open Sans', Arial; }
.navbar-nav > li {
float: none;
display: inline-block;
margin-left: -5px;
border-left: 2px solid #333240;
} .navbar-nav > li > a {
padding-top: 10px;
padding-bottom: 10px;
padding-right: 45px;
padding-left: 45px; }
Navbar gap image 我怎么能从导航栏的底部删除那个间隙?
答案 0 :(得分:0)
答案 1 :(得分:0)
Bootstrap适用.navbar { min-height: 50px; }
。只需使用min-height: 0;
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<style>
.navbar-nav {
margin: 0;
text-align: center;
font-size: .9em;
width: 100%;
font-weight: bold;
text-transform: uppercase;
font-family: Roboto, 'Open Sans', Arial;
}
.navbar-nav > li {
float: none;
display: inline-block;
margin-left: -5px;
border-left: 2px solid #333240;
}
.navbar-nav > li > a {
padding-top: 10px;
padding-bottom: 10px;
padding-right: 45px;
padding-left: 45px;
}
.navbar {
min-height: 0;
}
</style>
<nav class="navbar navbar-inverse">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Page 1</a></li>
<li><a href="#">Page 2</a></li>
<li class="navfixborder"><a href="#">Page 3</a></li>
</ul>
</div>
</div>
</nav>
&#13;
答案 2 :(得分:0)
Bootstrap为min-height: 50px
类设置.navbar
。解决方案是将min-height
设置为零:
.navbar {
min-height: 0;
}
答案 3 :(得分:-2)
.navbar-nav {
margin: 0;
text-align: center;
font-size: .9em;
width:100%;
font-weight: bold;
text-transform: uppercase;
font-family: Roboto, 'Open Sans', Arial; } .navbar-nav > li {
float: none;
display: inline-block;
margin-left: -5px;
border-left: 2px solid #333240;
} .navbar-nav > li > a {
padding-top: 10px;
padding-bottom: 10px;
padding-right: 45px;
padding-left: 45px; }
&#13;
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<nav class="navbar navbar-inverse">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Page 1</a></li>
<li><a href="#">Page 2</a></li>
<li class="navfixborder"><a href="#">Page 3</a></li>
</ul>
</div>
</div>
</nav>
&#13;