I encountered a problem with the bootstrap navbar.
I Made menu using the navbar-static-top - at first it was all good. When menu was expanded and few items added, and now with the width before to collapse, it is spreading into two lines that looks awful. In CSS bootstrap'a dig deeper, but without much success. Please help, how to be here?
Currently it looks like shown here:
Navbar code:
<div class="navbar-wrapper">
<div class="container">
<div class="navbar navbar-inverse navbar-static-top" role="navigation">
<div class="container">
<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="bright-logo-text navbar-brand" href="index.html">Clipboard Stripper</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>Home</li>
<li class="dropdown">
Features<b class="caret"></b>
<ul class="dropdown-menu">
<li>Features</li>
<li>Screenshots</li>
<li class="active">Usage</li>
</ul>
</li>
<li>Features</li>
<li>Screenshots</li>
<!--li class="active">Usage</li-->
<li>Download</li>
<li>Purchase</li>
<!--li class="dropdown">
Dropdown <b class="caret"></b>
<ul class="dropdown-menu">
</ul>
</li-->
</ul>
<ul class="nav navbar-nav navbar-right">
<li>Contact</li>
<li> </li>
</ul>
</div>
</div>
</div>
</div>
</div>
I also wanted to use it through CSS without redownloading and customizing Bootstrap, Skelly answer is working fine on Bootstrap 3 but in my case Bootstrap 3.2 the CSS changed a litte... Here is an updated version of all CSS required
#media (max-width:992px){
.navbar-header {
float: none;
}
.navbar-left,.navbar-right {
float: none !important;
}
.navbar-toggle {
display: block;
}
.navbar-collapse {
border-top: 1px solid transparent;
box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}
.navbar-fixed-top {
top: 0;
border-width: 0 0 1px;
}
.navbar-collapse.collapse {
display: none!important;
}
.navbar-nav {
float: none!important;
margin-top: 7.5px;
}
.navbar-nav>li {
float: none;
}
.navbar-nav>li>a {
padding-top: 10px;
padding-bottom: 10px;
}
.collapse.in{
display:block !important;
}
}
You can have it collapse sooner using a CSS media query. The default breakpoint is 768px. Here we change it to 990 pixels so that it collapses before the 2-line wrapping starts..
#media (max-width: 990px) {
.navbar-header {
float: none;
}
.navbar-toggle {
display: block;
}
.navbar-collapse {
border-top: 1px solid transparent;
box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}
.navbar-collapse.collapse {
display: none!important;
}
.navbar-nav {
float: none!important;
margin: 7.5px -15px;
}
.navbar-nav>li {
float: none;
}
.navbar-nav>li>a {
padding-top: 10px;
padding-bottom: 10px;
}
}
Demo: http://www.bootply.com/119436
Related
I want to make my navbar links have a darker background color whenever I hover my mouse over them. It is working OK, but when I change padding (to 0px in this case) it starts to flicker: (View on full screen for better effect)
Also, the image link is not the same height as the other links(And when collapsed, it has this right blank space), and I can't get it in same line using the current styling rules.
**Edit: It's caused by the padding:0px!important, but that's because I do not want the hovering background to take the entire height. How to make the hovering background with less height?
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" rel="stylesheet"/>
<style>
.navbar {
min-height: 80px;
font-size: 0.8rem;
font-weight:500;
}
.navbar-brand {
padding: 0 15px;
height: 80px;
line-height: 80px;
}
.navbar-toggle {
/* (80px - button height 34px) / 2 = 23px */
margin-top: 23px;
padding: 9px 10px !important;
}
#media (min-width: 768px) {
.navbar-nav > li > a {
/* (80px - line-height of 27px) / 2 = 26.5px */
padding-top: 26.5px;
padding-bottom: 26.5px;
line-height: 27px;
}
}
.bottom-space {
margin-bottom: 20px;
}
#navbar_logged_in > a:link {
color: white ;
}
#navbar_logged_in > a:hover {
opacity:0.7 ;
}
#navbar_logged_in > a:visited {
color: white ;
}
#navbar_logged_in > li.nav-link{
color:white;
}
.nav-pills .nav-link.active, .nav-pills .show > .nav-link{
background-color: #17A2B8;
}
body {
padding-top: 110px;
}
.main-nav a:hover {
background-color: #0D47A1!important;
padding: 0px!important;
}
</style>
<nav id="navbar_logged_in" class="navbar navbar-expand-lg navbar-light bottom-space fixed-top" style="background: linear-gradient(to right, #3399ff , #1a8cff, #0080ff, #0073e6);">
<div class="container">
<a class="navbar-brand mx-auto" href="#">
Logo
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo02" aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse text-right" id="navbarTogglerDemo02">
<ul class="navbar-nav ml-auto mt-2 mt-lg-0">
<li class="nav-item main-nav">
<a class="nav-link" href="#" style="color:white;margin-right:25px;">
<img class="img-circle" src="Image" alt="Image" width="35" height="35" style="border-radius: 50%!important;">
</a>
</li>
<li class="nav-item main-nav">
<a id="homepage_link" class="nav-link" href="#" style="color:white">Homepage</a>
</li>
<li class="nav-item main-nav">
<a class="nav-link" href="#" style="color:white">About</a>
</li>
<li class="nav-item main-nav">
<a class="nav-link" href="#" style="color:white">Log Out</a>
</li>
</ul>
</div>
</div>
</nav>
What's causing that? How can I fix it?
Thanks
The flickering is caused because when you hover, you are removing the padding, which pulls the element out from under the cursor. This then stops the hover and reapplies the padding which puts it back under the cursor, triggering the hover state. Rinse and repeat.
To stop the flicker, you need these two styles to work together:
#media (min-width: 768px) {
.navbar-nav > li > a {
padding-top: 26.5px;
padding-bottom: 26.5px;
line-height: 27px;
}
}
.main-nav a:hover {
background-color: #0D47A1!important;
padding: 0px!important;
}
If you want the hovering background to take less height, replace the part that you don't want the background on with margin. This might look like:
#media (min-width: 768px) {
.navbar-nav > li > a {
padding: 6.5px 8px; /* top/bottom, sides */
margin: 20px 0px;
line-height: 27px;
}
}
.main-nav a:hover {
background-color: #0D47A1!important;
}
In short, don't make your box size change on hover, and if you don't want background, use margin instead of padding
The padding in the hover is causing the problem: padding: 10px!important;
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" rel="stylesheet"/>
<style>
.navbar {
min-height: 80px;
font-size: 0.8rem;
font-weight:500;
}
.navbar-brand {
padding: 0 15px;
height: 80px;
line-height: 80px;
}
.navbar-toggle {
/* (80px - button height 34px) / 2 = 23px */
margin-top: 23px;
padding: 9px 10px !important;
}
#media (min-width: 768px) {
.navbar-nav > li > a {
/* (80px - line-height of 27px) / 2 = 26.5px */
padding-top: 26.5px;
padding-bottom: 26.5px;
line-height: 27px;
}
}
.bottom-space {
margin-bottom: 20px;
}
#navbar_logged_in > a:link {
color: white ;
}
#navbar_logged_in > a:hover {
opacity:0.7 ;
}
#navbar_logged_in > a:visited {
color: white ;
}
#navbar_logged_in > li.nav-link{
color:white;
}
.nav-pills .nav-link.active, .nav-pills .show > .nav-link{
background-color: #17A2B8;
}
body {
padding-top: 110px;
}
.main-nav a:hover {
background-color: #0D47A1!important;
}
</style>
<nav id="navbar_logged_in" class="navbar navbar-expand-lg navbar-light bottom-space fixed-top" style="background: linear-gradient(to right, #3399ff , #1a8cff, #0080ff, #0073e6);">
<div class="container">
<a class="navbar-brand mx-auto" href="#">
Logo
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo02" aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse text-right" id="navbarTogglerDemo02">
<ul class="navbar-nav ml-auto mt-2 mt-lg-0">
<li class="nav-item main-nav">
<a class="nav-link" href="#" style="color:white;margin-right:25px;">
<img class="img-circle" src="Image" alt="Image" width="35" height="35" style="border-radius: 50%!important;">
</a>
</li>
<li class="nav-item main-nav">
<a id="homepage_link" class="nav-link" href="#" style="color:white">Homepage</a>
</li>
<li class="nav-item main-nav">
<a class="nav-link" href="#" style="color:white">About</a>
</li>
<li class="nav-item main-nav">
<a class="nav-link" href="#" style="color:white">Log Out</a>
</li>
</ul>
</div>
</div>
</nav>
I have a navbar with many links/options:
When I collapsed it, some options are totally off the screen and I can't click on them:
In the pic, I can see link 4, but not link 5 and link 6.
Using a dropdown menu will do the same thing.
.navbar {
border: 0;
border-bottom: 1px solid #FFF;
background-color: #111 !important;
border-radius: 0px;
}
/* Adjust Toggle button */
.navbar-toggle {
margin-top: 18px;
}
/* Adjust Navbar Height */
.navbar-brand,
.navbar-nav li a {
padding-top: 0;
}
.navbar-brand,
.navbar-nav li a {
color: #FFF !important;
line-height: 70px;
height: 70px;
}
.navbar-brand {
color: #0CF !important;
}
.navbar-brand:hover,
.navbar-nav li a:hover {
background-color: #06C !important;
color: #0f9 !important;
}
.dropdown-menu > li > a {
line-height: 40px;
height: 40px;
}
.navbar-nav .open .dropdown-toggle {
background-color: #222 !important;
}
.navbar div ul li .dropdown-menu {
background-color: #222;
border-top: 2px solid #09f;
}
/* Nav Affix */
nav.affix {
position: fixed;
top: 0;
width: 100%;
z-index:10;
}
.affix + .container {
padding-top: 90px;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.
<nav class="navbar navbar-default" data-spy="affix" data-offset-top="308">
<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>
<a class="navbar-brand" href="#">
<i class="fa fa-adjust" aria-hidden="true"></i>
Brand
</a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav navbar-left">
<li>Storyline</li>
<li>Characters</li>
<li>Gallery</li>
<!--li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Misc<span class="caret"></span></a>
<ul class="dropdown-menu">
<li>About</li>
<li>Contact</li>
<li>Other</li>
</ul>
</li-->
<li>Link 1</li>
<li>Link 2</li>
<li>Link 3</li>
<li>Link 4</li>
<li>Link 5</li>
<li>Link 6</li>
</ul>
</div>
</div>
</nav>
<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.
<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.
<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.
<script src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
Something is wrong with your javascript probably. I see there is class .affix-top getting added to the .navbar .navbar-default. Remove that and your nav will scroll properly.
I'm new to Bootstrap and I'm trying to center the navbar both horizontally and vertically so it looks something like this but I can't seem to figure it out.
Here's the html:
<html>
<body>
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#nav" aria-expanded="false">
<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="nav">
<ul class="nav navbar-nav">
<li class="active">Home</li>
<li>Portfolio</li>
<li>Blog</li>
<li>Pages</li>
<li>Features</li>
<li>Mega menu</li>
<li>Contact</li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
</body>
</html>
and CSS:
nav {
color: #fff;
height: 112px;
text-transform: uppercase;
font-size: 15px;
font-weight: bold;
}
If you want to center the links you need to apply those rules to the .navbar-nav and li classes (most likely you'll want these inside a media-query as well).
Centered Links CSS
#media (min-width: 768px) {
.navbar.navbar-default .navbar-nav {
width: 100%;
text-align: center;
}
.navbar.navbar-default .navbar-nav > li {
display: inline-block;
float: none
}
}
And you can use line-height to adjust the height of your links so they're vertically aligned.
Vertical Link Alignment
#media (min-width: 768px) {
.navbar.navbar-default .navbar-nav > li > a {
line-height: 4;
}
}
Working Example:
.navbar.navbar-default {
background: white;
border: 1px solid transparent
}
.navbar.navbar-default .navbar-nav.navbar-center > li > a,
.navbar.navbar-default .navbar-search > li > a {
color: #266080;
}
#media (max-width: 767px) {
.navbar.navbar-default {
padding: 15px 0;
}
.navbar.navbar-default .navbar-collapse {
margin-top: 15px;
margin-bottom: -15px;
border: 0;
box-shadow: none;
}
}
#media (min-width: 768px) {
.navbar.navbar-default {} .navbar.navbar-default .navbar-nav.navbar-center {
width: 100%;
text-align: center;
}
.navbar.navbar-default .navbar-nav.navbar-center > li {
display: inline-block;
float: none
}
.navbar.navbar-default .navbar-nav.navbar-center > li > a {
line-height: 4;
text-transform: uppercase;
font-size: 14px;
font-weight: bold;
}
.navbar.navbar-default .navbar-search {
position: absolute;
right: 2%;
top: 17px;
line-height: 4;
font-size: 20px;
}
}
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<nav class="navbar navbar-default navbar-static-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#nav" aria-expanded="false">
<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="nav">
<ul class="nav navbar-nav navbar-center">
<li class="active">Home
</li>
<li>Portfolio
</li>
<li>Blog
</li>
<li>Pages
</li>
<li>Features
</li>
<li>Mega menu
</li>
<li>Contact
</li>
</ul>
<ul class="nav navbar-nav navbar-right navbar-search">
<li><span class="glyphicon glyphicon-search"></span>
</li>
</ul>
</div>
</div>
</nav>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
This question already has answers here:
Bootstrap 3 Navbar Collapse
(12 answers)
Closed 6 years ago.
I've been learning bootstrap 3 and sass for last few days. Anyway, I'm trying to make a navbar that collapses when screen size is below 1000px. And it works, but when I click on toggle button, to show menu dropdown, it opens, then instantly closes.
Here is the code: http://jsbin.com/zahatekisa/edit?html,css,output
.navbar {
background-color: #202C39;
}
div.navbar-header a.navbar-brand {
font-family: "Caveat Brush";
margin-right: 20px;
font-size: 23px;
color: #F29559;
}
div.navbar-header a.navbar-brand:hover {
color: #ffb36b;
}
ul.nav.navbar-nav li a {
font-family: "PT Sans", "cursive";
color: #e6e6e6;
}
ul.nav.navbar-nav li a:hover {
color: #ffffff;
background-color: #2a394a;
}
ul.navbar-right li p.navbar-text {
display: block;
}
#media (max-width: 1050px) {
ul.navbar-right li a {
float: left;
}
ul.navbar-right li p.navbar-text {
margin-left: 15px;
position: relative;
top: -4px;
}
}
#media (max-width: 1000px) {
.navbar-header {
float: none;
}
.navbar-toggle {
display: block;
}
.navbar-collapse {
border-top: 1px solid transparent;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.navbar-collapse.collapse {
display: none !important;
}
.navbar-nav {
float: none !important;
margin: 7.5px -15px;
}
.navbar-nav > li {
float: none;
}
.navbar-nav > li > a {
padding-top: 10px;
padding-bottom: 10px;
}
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<!--Making the toggle button-->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!--Logo-->
Lorem ipsum dolor.
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li>Lorem
</li>
<li>Lorem
</li>
<li>Lorem
</li>
<li>Lorem
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<p class="navbar-text">Contact Me:</p>
</li>
<li><i class="fa fa-facebook-official" aria-hidden="true"></i>
</li>
<li><i class="fa fa-twitter-square" aria-hidden="true"></i>
</li>
<li><i class="fa fa-skype" aria-hidden="true"></i>
</li>
<li><i class="fa fa-envelope" aria-hidden="true"></i>
</li>
</ul>
</div>
</div>
</nav>
The problem here is this particular style you have, which is forcing the navbar to be hidden regardless of whether it is open or closed:
#media (max-width: 1000px) {
.navbar-collapse.collapse {
display: none !important;
}
}
I can see what you're doing here - you're trying to combine Bootstrap's .collapse class with your own custom addition to the navbar. However, there's a problem with your logic: I suspect you wrote your style under the assumption that Bootstrap toggles .collapse to hide or show collapsed content. This is incorrect. In fact, Bootstrap toggles .in for this - so you should not be hiding the content if the element has the class .in. Simply change your selector to:
#media (max-width: 1000px) {
.navbar-collapse.collapse:not(.in) {
display: none !important;
}
}
Here's the fix in context:
.navbar {
background-color: #202C39;
}
div.navbar-header a.navbar-brand {
font-family: "Caveat Brush";
margin-right: 20px;
font-size: 23px;
color: #F29559;
}
div.navbar-header a.navbar-brand:hover {
color: #ffb36b;
}
ul.nav.navbar-nav li a {
font-family: "PT Sans", "cursive";
color: #e6e6e6;
}
ul.nav.navbar-nav li a:hover {
color: #ffffff;
background-color: #2a394a;
}
ul.navbar-right li p.navbar-text {
display: block;
}
#media (max-width: 1050px) {
ul.navbar-right li a {
float: left;
}
ul.navbar-right li p.navbar-text {
margin-left: 15px;
position: relative;
top: -4px;
}
}
#media (max-width: 1000px) {
.navbar-header {
float: none;
}
.navbar-toggle {
display: block;
}
.navbar-collapse {
border-top: 1px solid transparent;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.navbar-collapse.collapse:not(.in) {
display: none !important;
}
.navbar-nav {
float: none !important;
margin: 7.5px -15px;
}
.navbar-nav > li {
float: none;
}
.navbar-nav > li > a {
padding-top: 10px;
padding-bottom: 10px;
}
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<!--Making the toggle button-->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!--Logo-->
Lorem ipsum dolor.
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li>Lorem
</li>
<li>Lorem
</li>
<li>Lorem
</li>
<li>Lorem
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<p class="navbar-text">Contact Me:</p>
</li>
<li><i class="fa fa-facebook-official" aria-hidden="true"></i>
</li>
<li><i class="fa fa-twitter-square" aria-hidden="true"></i>
</li>
<li><i class="fa fa-skype" aria-hidden="true"></i>
</li>
<li><i class="fa fa-envelope" aria-hidden="true"></i>
</li>
</ul>
</div>
</div>
</nav>
(Something else worth noting is that you may want to use max-width: 768px rather than max-width: 1000px for your media query, since that's the Bootstrap breakpoint for "tablet" sized devices.)
I have an issue with Bootstrap 3. I don't know why, but in mobile screen there is space between navbar-brand and navigation bar ending. I guess, it is because of navigation bar glyphicon doesn't fit my navigation bar. How can I solve this issue? I just need to remove that empty space...
Desktop-size version:
Mobile-size version:
HTML:
<header class="top" role="header">
<div class="container">
<a href="../aplikacija/app.html" class="navbar-brand pull-left">
Brand
</a>
<button class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="glyphicon glyphicon-align-justify"></span>
</button>
<nav class="navbar-collapse collapse" role="navigation">
<ul class="navbar-nav nav">
<li>Page 1</li>
<li>Page 2</li>
</ul>
</nav>
</div>
</header>
CSS:
div.container {
background-color: #474747;
display: block;
width: 80%;
height: auto;
margin-left: auto;
margin-right: auto;
padding-left: 0px;
}
a.navbar-brand {
text-shadow: none;
background-color: #ccc;
color: #474747;
margin-left: 0px;
}
ul.navbar-nav li a{
text-shadow: none;
color: #ccc;
}
ul.navbar-nav li a:hover {
background-color: #373737;
color: #ccc
}
button.navbar-toggle {
color: #ffffff;
}
span.glyphicon {
color: #009B9B;
}
You can remove this space by removing the margin-bottom from the .navbar-toggle:
button.navbar-toggle {
color: #ffffff;
margin-bottom: 0px !important;
}
!important is optional, i can't tell you right now if you need this, just test it.