I have the following Twitter Bootstrap navigation bar design that currently looks like the following image…
At the moment when it is put into practice it looks like the following…
It is just the standard bootstrap code and CSS that is being used. I am also wondering how to remove the slight gap that you can see both at the top and bottom of the active tab.
Thanks in advance.
Edit:
This is the current code for the navigation bar.
.navbar {
margin-bottom: 0;
}
.navbar-branded {
background-color: #00b9f2;
font-weight: bold;
border-radius: 0;
}
.navbar-branded .navbar-brand {
color: #ffffff;
}
.navbar-branded .navbar-brand:hover,
.navbar-branded .navbar-brand:focus {
color: #00b9f2;
}
.navbar-branded .navbar-text {
color: #ffffff;
}
.navbar-branded .navbar-nav > li > a {
color: #ffffff;
}
.navbar-branded .navbar-nav > li > a:hover,
.navbar-branded .navbar-nav > li > a:focus {
color: #00b9f2;
}
.navbar-branded .navbar-nav > .active > a,
.navbar-branded .navbar-nav > .active > a:hover,
.navbar-branded .navbar-nav > .active > a:focus {
color: #00b9f2;
background-color: #ffffff;
}
.navbar-branded .navbar-nav > .open > a,
.navbar-branded .navbar-nav > .open > a:hover,
.navbar-branded .navbar-nav > .open > a:focus {
color: #00b9f2;
}
.navbar-branded .navbar-toggle {} .navbar-branded .navbar-toggle:hover,
.navbar-branded .navbar-toggle:focus {
background-color: #ffffff;
}
.navbar-branded .navbar-toggle .icon-bar {
background-color: #ffffff;
}
.navbar-branded .navbar-collapse,
.navbar-branded .navbar-form {} .navbar-branded .navbar-link {
color: #ffffff;
}
.navbar-branded .navbar-link:hover {
color: #00b9f2;
}
@media (max-width: 767px) {
.navbar-branded .navbar-nav .open .dropdown-menu > li > a {
color: #ffffff;
}
.navbar-branded .navbar-nav .open .dropdown-menu > li > a:hover,
.navbar-branded .navbar-nav .open .dropdown-menu > li > a:focus {
color: #00b9f2;
}
.navbar-branded .navbar-nav .open .dropdown-menu > .active > a,
.navbar-branded .navbar-nav .open .dropdown-menu > .active > a:hover,
.navbar-branded .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #00b9f2;
background-color: #ffffff;
}
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<nav class="navbar navbar-branded">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs" aria-expanded="false">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="bs">
<ul class="nav navbar-nav">
<li class="active">
<a href="#">Home</a>
</li>
<li>
<a href="#">Our Team</a>
</li>
<li>
<a href="#">Schedule</a>
</li>
<li>
<a href="#">Requests</a>
</li>
<li>
<a href="#">News</a>
</li>
<li>
<a href="#">Partners</a>
</li>
<li>
<a href="#">Contact us</a>
</li>
</ul>
</div>
</div>
</nav>
2
Answers
You can use a table layout to distribute your links across the navbar and I believe you’re referring to the border that surrounds the navbar when it comes to the “gap” around the active link:
border: none;
.See working Example Snippet at Full Page.
You can take advantage of bootstrap’s built-in class .nav-justified and edit background and links colors and padding to match your design.