Bootstrap 3 collapsed navbar - html

Got a problem on my bootstrap 3 navbar thats never happened in any of my other projects.
Images:
when the navbar is collapsed it doesn't open to the full width of the window it opens only to a certain width in the middle of the screen could someone help me fix this?
Code: (I use SASS for css)
.navbar {
border: none;
border-radius: 0;
margin-right: 25px;
background-color: transparent;
border-color: transparent;
-webkit-transition: all 0.6s ease-out;
-moz-transition: all 0.6s ease-out;
-o-transition: all 0.6s ease-out;
-ms-transition: all 0.6s ease-out;
transition: all 0.6s ease-out;
}
.navbar .scrolled {
background: white;
background: white;
}
.navbar-nav li a {
color: #fff;
border: 3px solid transparent;
border-radius: 0px;
transition: background 0.5s;
margin-top: 10px;
padding-top: 5px;
padding-bottom: 5px;
}
.navbar-default .navbar-nav li a {
color: #fff;
border: 3px solid transparent;
border-radius: 0px;
transition: background 0.5s;
margin-top: 10px;
padding-top: 5px;
padding-bottom: 5px;
}
.navbar-default .navbar-nav li a:hover {
text-decoration: none;
color: #fff;
border: 3px solid white;
border-radius: 0px;
background-color: transparent;
background: transparent;
}
.navbar-default .navbar-nav .active a {
text-decoration: none;
border: 3px solid white;
border-radius: 0px;
color: #fff;
background-color: transparent;
background: transparent;
}
.navbar-default .navbar-nav .active a:hover {
background-color: transparent;
color: #fff;
}
.navbar-toggle {
position: relative;
float: right;
padding: 9px 10px;
margin-top: 8px;
margin-right: 15px;
margin-bottom: 8px;
background-color: transparent;
background-image: none;
border: 1px solid #fff;
border-radius: 4px;
}
.navbar-toggle .icon-bar {
display: block;
width: 22px;
height: 2px;
color: #fff;
border-radius: 1px;
border: 1px solid #fff;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js"></script>
<nav id="mainNav" class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<div lass="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<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 page-scroll" href="#page-top">
<img src="assets/img/logo.png" alt="logo">
</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li>About us
</li>
<li>Our venues
</li>
<li>Spaces & Services
</li>
<li>News & events
</li>
<li class="active">Give us a shout
</li>
</ul>
</div>
</div>
</nav>

Related

Bootstrap Dropdown Menu Link Won't Align with Rest of Links in Navbar

For some reason dropdown links do not align with the rest of the links in the Bootstrap navbar and are positioned lower. I can also see when using a the live preview that it is positioned strangely within its boundaries which you can see in my screen shot. The blue outline represents ".dropdown"
I found someone having the exact same problem here:
How to align dropdown menu in Navbar in Bootstrap with css?
However, that solution is not working for me. In fact I cannot change the position of the drop down link at all with positioning, margins or padding.
HTML:
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button id="menuButton" type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span><br>
<span class="icon-bar"></span><br>
<span class="icon-bar"></span>
</button>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav nav-pills nav-justified">
<li class="active"><img src="images/rainbowLogo.png" id="homeLogo"></li>
<li class="dropdown">
<a class="navbar-brand dropdown-toggle" id="dropdown" type="button" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="true">Menus
<span class="caret"></span></a>
<ul class="dropdown-menu">
<li>Store Menu</li>
<li>Weedmaps</li>
</ul>
</li>
<li>Pakablog</li>
<li>Apparel</li>
<li>About</li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
CSS:
.navbar.navbar-inverse.navbar-fixed-top {
display: block;
margin: 0 auto;
width: 100%;
height:110px;
max-width: 1920px;
background-color: #222222;
}
.nav.nav-pills li a{
line-height: 3em;
padding: 0px;
padding-left: 5px;
padding-right: 5px;
color: white;
background-color: #222222;
font-family: 'Wendy One', sans-serif;
font-size: 36px;
display: table-cell;
margin-top: -49px;
-webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
}
.nav-pills li a:hover{
color: #4EB848;
background-color: #222222;
}
.nav-pills>li.active>a, .nav-pills>li.active>a:hover, .nav-pills>li.active>a:focus{
color: #4EB848;
background-color: #222222;
}
#media (min-width: 768px) and (max-width: 991px) {
.navbar-collapse.collapse {
display: none !important;
}
.navbar-collapse.collapse.in {
display: block !important;
}
.navbar-header .collapse, .navbar-toggle {
display:block !important;
}
.navbar-header {
float:none;
}
}
#menuButton {
width:80px;
height: 80px;
align-content: center;
border-color: white;
}
.navbar-toggle .icon-bar {
display: block;
width: 55px;
height: 5px;
background-color: #cccccc;
}
.dropdown:hover .dropdown-menu {
display: block;
}
.dropdown-menu:hover{
display: block;
}
.navbar-brand.dropdown-toggle {
margin: 0px;
}
.dropdown {
position: absolute;
margin: 0px;
padding: 0px;
}
.dropdown-menu {
margin-top: 45px;
margin-left: -20px;
padding: 10px;
}
I was able to align the dropdown menu with the rest of the links in the bootstrap navbar with line-height in .nav.nav-pills li a{}. I forgot I had used it earlier in the project to accomplish a general alignment of the links in the navbar. Further adjusting the value from 3em to 2.1em brought the dropdown menu to the position of the other links:
.nav.nav-pills li a{
**line-height: 2.1em;**
padding: 0px;
padding-left: 5px;
padding-right: 5px;
color: white;
background-color: #222222;
font-family: 'Wendy One', sans-serif;
font-size: 36px;
display: table-cell;
margin-top: -49px;
-webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
}

Creating a Bootstrap navbar collapse overlay menu

I am trying to get an overlay menu when the user clicks on the burger menu it takes up the whole screen, Something like this :
I for some reason cant seem to get it to work at all , i have tried to use examples but it might be because i am not that experienced with bootstrap but it wont overlay the menu at all.
So i have set it up so the burger menu appears at 991px using media queries and it works fine but getting the overlay to pop up is not happening at all.
HTML:
<nav class="navbar navbar-default navbar-fixed-top" id="section1">
<div class="container">
<div class="navbar-header">
<button class="navbar-toggle" data-target="#myNavbar" data-toggle="collapse" type="button">
<span class="icon-bar"></span> <span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand"><img alt="" src="Images/logo.png" class="img-responsive"></a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav navbar-right">
<li>
Home
</li>
<li>
About Me
</li>
<li>
Game
</li>
<li>
Me
</li>
<li>
Hobbies
</li>
<li>
Contact Me
</li>
</ul>
</div>
</div>
</nav>
<div class="modal fade" id="nav-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-nav-content">
<div class="modal-nav-body">
<ul>
<li>Brand</li>
<li>About Me</li>
<li>Game</li>
<li>Hobbies</li>
<li>Contact Me</li>
</ul>
</div>
</div>
</div>
</div>
CSS:
#media only screen and (max-width: 991px) {
.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;
}
.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;
}
.modal-nav-content {
width: 100%;
height: auto;
}
.modal-nav-body {
margin-top: 100px;
}
.modal-nav-body ul {
list-style-type: none;
color: white;
margin: 0;
padding: 0;
width: 100%;
}
.modal-nav-body ul li {
text-align: center;
font-size: 130%;
padding: 8px;
text-transform: uppercase;
}
}
You can see the full code here : Fiddle Link
No idea why its not working but i am guessing its something to do with me not using bootstrap correctly ,
Thanks again for all the help
For that you need to use javascript ( or jQuery in my example ) .
First, you need an overlay. I created a div with class .overlay , fixed, full height and width with red background and opacity
Second, you need to position your menu . I positioned in center ( vertically and horizontally ). ( in below 991px media query )
Third, with a little bit of jQuery i made the effect you wanted. You can change/style the code as you please. But what i made for you should be more than enough to help you achieve exactly what you want
Fourth, here on Stack Overflow we don't make free code. We just help you make your code functional. You should try and research more on a subject before posting here for help
See jsFIddle or snippet below
$(".navbar-toggle").on("click", function() {
$(".overlay").fadeIn("slow")
})
$(".overlay").on("click", function() {
$(this).fadeOut();
$(".navbar-collapse").removeClass("in").addClass("collapse")
})
body {
background-color: Black;
}
.navbar-default {
background-color: transparent;
border-top: 0px solid rgba(0, 0, 0, 0.5);
border-bottom: 0px solid rgba(0, 0, 0, 0.5);
border-left: 0px solid rgba(0, 0, 0, 0.5);
border-right: 0px solid rgba(0, 0, 0, 0.5);
-webkit-transition: background-color 200ms linear;
-moz-transition: background-color 200ms linear;
-o-transition: background-color 200ms linear;
-ms-transition: background-color 200ms linear;
transition: background-color 200ms linear;
padding-top: 9px;
padding-bottom: 26px;
}
.navbar.navbar-default .navbar-collapse {
border: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
.navbar-nav>li {
border-right: 1px solid white;
padding-left: 14px;
padding-right: 14px;
height: 32px;
}
.navbar-nav {
padding-top: 20px;
}
.navbar-nav>li:last-child {
border: none;
}
.navbar-default .navbar-toggle {
border-color: rgba(0, 0, 0, 0);
}
.navbar-default .navbar-toggle .icon-bar {
background-color: #fff;
}
.navbar-toggle {
margin-top: 19px;
margin-right: 43px;
}
.navbar-default .navbar-nav>li>a {
color: white;
font-size: 15px;
line-height: 1px;
}
.navbar-default .navbar-nav>li>a:hover,
.navbar-default .navbar-nav>li>a:focus {
color: #fff;
background-color: rgba(255, 198, 0, 0);
-webkit-transition: background-color 200ms linear;
-moz-transition: background-color 200ms linear;
-o-transition: background-color 200ms linear;
-ms-transition: background-color 200ms linear;
transition: background-color 200ms linear;
}
.navbar-default .navbar-nav>li>a {
display: inline-block;
position: relative;
padding-bottom: 3px;
}
.navbar-default .navbar-nav>li>a:after {
content: '';
display: block;
margin: auto;
height: 1px;
width: 0px;
background: transparent;
transition: width .4s ease, background-color .4s ease;
margin-top: 12px;
}
.navbar-default .navbar-nav>li>a:hover:after {
width: 100%;
background: #FFC600;
}
.navbar-default .navbar-nav>.active>a,
.navbar-default .navbar-nav>.active>a:focus,
.navbar-default .navbar-nav>.active>a:hover {
color: #fff;
background-color: rgba(255, 198, 0, 0);
border-bottom: solid #FFC600;
border-bottom-width: 1px;
height: 29px;
}
#media only screen and (max-width: 991px) {
.navbar-collapse {
position: fixed;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
text-align: center;
}
.overlay {
position: fixed;
width: 100%;
height: 100%;
background: red;
opacity: 0.5;
left: 0;
top: 0;
display: none;
}
.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;
}
.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;
}
.modal-nav-content {
width: 100%;
height: auto;
}
.modal-nav-body {
margin-top: 100px;
}
.modal-nav-body ul {
list-style-type: none;
color: white;
margin: 0;
padding: 0;
width: 100%;
}
.modal-nav-body ul li {
text-align: center;
font-size: 130%;
padding: 8px;
text-transform: uppercase;
}
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<nav class="navbar navbar-default navbar-fixed-top" id="section1">
<div class="container">
<div class="navbar-header">
<button class="navbar-toggle" data-target="#myNavbar" data-toggle="collapse" type="button">
<span class="icon-bar"></span> <span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand"><img alt="" src="Images/logo.png" class="img-responsive"></a>
</div>
<div class="overlay">
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav navbar-right">
<li>
Home
</li>
<li>
About Me
</li>
<li>
Game
</li>
<li>
Me
</li>
<li>
Hobbies
</li>
<li>
Contact Me
</li>
</ul>
</div>
</div>
</nav>
<div class="modal fade" id="nav-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-nav-content">
<div class="modal-nav-body">
<ul>
<li>Brand</li>
<li>About Me</li>
<li>Game</li>
<li>Hobbies</li>
<li>Contact Me</li>
</ul>
</div>
</div>
</div>
</div>
I would suggest creating a modal and initiating it on a .on('click' function(){}) of the menu item. that way just the backdrop should be good enough to hide everything behind and the focus would be on the modal. If you are not to familiar with bootstrap easier solution would be to use the bootstrap.dialogue library. here is a link to some examples. Please let me know if you have any other questions.
https://nakupanda.github.io/bootstrap3-dialog/

-o-transition: margin 200ms ease-out not working in windows machine

-o-transition: margin 200ms ease-out not working in windows machine
body,
html {
height: 100%;
}
nav.sidebar,
.main {
-webkit-transition: margin 200ms ease-out;
-moz-transition: margin 200ms ease-out;
-o-transition: margin 200ms ease-out;
transition: margin 200ms ease-out;
}
.main {
padding: 10px 10px 0 10px;
}
#media (min-width: 765px) {
.main {
position: absolute;
width: calc(100% - 40px);
margin-left: 40px;
float: right;
}
nav.sidebar:hover+.main {
margin-left: 200px;
}
nav.sidebar.navbar.sidebar>.container .navbar-brand,
.navbar>.container-fluid .navbar-brand {
margin-left: 0px;
}
nav.sidebar .navbar-brand,
nav.sidebar .navbar-header {
text-align: center;
width: 100%;
margin-left: 0px;
}
nav.sidebar a {
padding-right: 13px;
}
nav.sidebar .navbar-nav>li:first-child {
border-top: 1px #e5e5e5 solid;
}
nav.sidebar .navbar-nav>li {
border-bottom: 1px #e5e5e5 solid;
}
nav.sidebar .navbar-nav .open .dropdown-menu {
position: static;
float: none;
width: auto;
margin-top: 0;
background-color: transparent;
border: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
nav.sidebar .navbar-collapse,
nav.sidebar .container-fluid {
padding: 0 0px 0 0px;
}
.navbar-inverse .navbar-nav .open .dropdown-menu>li>a {
color: #777;
}
nav.sidebar {
width: 200px;
height: 100%;
margin-left: -160px;
float: left;
margin-bottom: 0px;
}
nav.sidebar li {
width: 100%;
}
nav.sidebar:hover {
margin-left: 0px;
}
.forAnimate {
opacity: 0;
}
}
#media (min-width: 1330px) {
.main {
width: calc(100% - 200px);
margin-left: 200px;
}
nav.sidebar {
margin-left: 0px;
float: left;
}
nav.sidebar .forAnimate {
opacity: 1;
}
}
nav.sidebar .navbar-nav .open .dropdown-menu>li>a:hover,
nav.sidebar .navbar-nav .open .dropdown-menu>li>a:focus {
color: #CCC;
background-color: transparent;
}
nav:hover .forAnimate {
opacity: 1;
}
section {
padding-left: 15px;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" />
<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.0/js/bootstrap.min.js"></script>
<nav class="navbar navbar-default sidebar" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-sidebar-navbar-collapse-1">
<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="bs-sidebar-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active">Home<span style="font-size:16px;" class="pull-right hidden-xs showopacity glyphicon glyphicon-home"></span></li>
<li class="dropdown">
Usuarios <span class="caret"></span><span style="font-size:16px;" class="pull-right hidden-xs showopacity glyphicon glyphicon-user"></span>
<ul class="dropdown-menu forAnimate" role="menu">
<li>Crear</li>
<li>Modificar</li>
<li>Reportar</li>
<li class="divider"></li>
<li>Separated link</li>
<li class="divider"></li>
<li>Informes</li>
</ul>
</li>
<li>Libros<span style="font-size:16px;" class="pull-right hidden-xs showopacity glyphicon glyphicon-th-list"></span></li>
<li>Tags<span style="font-size:16px;" class="pull-right hidden-xs showopacity glyphicon glyphicon-tags"></span></li>
</ul>
</div>
</div>
</nav>
https://bootsnipp.com/snippets/featured/side-menu-on-hover
I think this is what you are looking for -
I just removed
nav.sidebar {
margin-left: 0px;
float: left;
}
from your #media (min-width: 1330px) and now its wokring fine. Please do check the answer in full screen to check. Hope this was helpfull fro you.
body,
html {
height: 100%;
}
nav.sidebar,
.main {
-webkit-transition: margin 200ms ease-out;
-moz-transition: margin 200ms ease-out;
-o-transition: margin 200ms ease-out;
transition: margin 200ms ease-out;
}
.main {
padding: 10px 10px 0 10px;
}
#media (min-width: 765px) {
.main {
position: absolute;
width: calc(100% - 40px);
margin-left: 40px;
float: right;
}
nav.sidebar:hover+.main {
margin-left: 200px;
}
nav.sidebar.navbar.sidebar>.container .navbar-brand,
.navbar>.container-fluid .navbar-brand {
margin-left: 0px;
}
nav.sidebar .navbar-brand,
nav.sidebar .navbar-header {
text-align: center;
width: 100%;
margin-left: 0px;
}
nav.sidebar a {
padding-right: 13px;
}
nav.sidebar .navbar-nav>li:first-child {
border-top: 1px #e5e5e5 solid;
}
nav.sidebar .navbar-nav>li {
border-bottom: 1px #e5e5e5 solid;
}
nav.sidebar .navbar-nav .open .dropdown-menu {
position: static;
float: none;
width: auto;
margin-top: 0;
background-color: transparent;
border: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
nav.sidebar .navbar-collapse,
nav.sidebar .container-fluid {
padding: 0 0px 0 0px;
}
.navbar-inverse .navbar-nav .open .dropdown-menu>li>a {
color: #777;
}
nav.sidebar {
width: 200px;
height: 100%;
margin-left: -160px;
float: left;
margin-bottom: 0px;
}
nav.sidebar li {
width: 100%;
}
nav.sidebar:hover {
margin-left: 0px;
}
.forAnimate {
opacity: 0;
}
}
#media (min-width: 1330px) {
.main {
width: calc(100% - 200px);
margin-left: 200px;
}
nav.sidebar .forAnimate {
opacity: 1;
}
}
nav.sidebar .navbar-nav .open .dropdown-menu>li>a:hover,
nav.sidebar .navbar-nav .open .dropdown-menu>li>a:focus {
color: #CCC;
background-color: transparent;
}
nav:hover .forAnimate {
opacity: 1;
}
section {
padding-left: 15px;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" />
<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.0/js/bootstrap.min.js"></script>
<nav class="navbar navbar-default sidebar" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-sidebar-navbar-collapse-1">
<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="bs-sidebar-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active">Home<span style="font-size:16px;" class="pull-right hidden-xs showopacity glyphicon glyphicon-home"></span></li>
<li class="dropdown">
Usuarios <span class="caret"></span><span style="font-size:16px;" class="pull-right hidden-xs showopacity glyphicon glyphicon-user"></span>
<ul class="dropdown-menu forAnimate" role="menu">
<li>Crear</li>
<li>Modificar</li>
<li>Reportar</li>
<li class="divider"></li>
<li>Separated link</li>
<li class="divider"></li>
<li>Informes</li>
</ul>
</li>
<li>Libros<span style="font-size:16px;" class="pull-right hidden-xs showopacity glyphicon glyphicon-th-list"></span></li>
<li>Tags<span style="font-size:16px;" class="pull-right hidden-xs showopacity glyphicon glyphicon-tags"></span></li>
</ul>
</div>
</div>
</nav>

Center Hamburger, Text and Remove Outline

I'm using Bootstrap, and I'd like to:
Center the hamburger in the navbar
Remove the boxed outline around the hamburger
Current hamburger:
Here's my code. I've tried a few solutions from here as well, but it still isn't working.
<nav class="navbar navbar-inverse navbar-static-top">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navMenu">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="navMenu">
<ul class="nav navbar-nav">
<li><a class="navtext" href="#">TEST 1</a></li>
<li><a class="navtext" href="#">TEST 2</a></li>
<li><a class="navtext" href="#">TEST 3</a></li>
<li><a class="navtext" href="#">TEST 4</a></li>
</ul>
</div>
</nav>
html {
background-color: black;
}
.navbar {
background-color: black;
color: black;
margin-bottom: 0!important;
}
.icon-bar {
color: #FFFFFF;
}
button {
color: #FFFFFF;
outline: none;
border:0px;
}
.navbar-header{
background-color: black;
color: black;
border: 0px;
}
.navbar-inverse {
background-color: black;
color: black;
}
#navMenu {
color: black;
background-color: black;
}
.container-fluid {
color: black;
background-color: black;
}
li {
color: #ffffff;
text-align: center;
}
.navbar-toggle {
border: none;
outline: none;
float: none;
margin-right:0;
}
a.navtext {
color: #ffffff;
border: 3px solid #000000;
width: 100px auto;
font-family: 'Montserrat', sans-serif;
text-decoration: none;
position: relative;
}
a.navtext:hover {
border: 3px solid #F22613!important;
background: #F22613!important;
}
a.navtext:before {
content: "";
position: absolute;
width: 100%;
height: 2px;
bottom: 0;
left: 0;
background-color: #fff;
visibility: hidden;
-webkit-transform: scaleX(0);
transform: scaleX(0);
-webkit-transition: all 0.3s ease-in-out 0s;
transition: all 0.3s ease-in-out 0s;
}
a.navtext:hover:before {
visibility: visible;
-webkit-transform: scaleX(1);
transform: scaleX(1);
}
ul.nav {
text-align: center!important;
}
EDIT: To clarify, I'm using Bootstrap 3.3.7. I've also got the centered text issue solved with
.navbar .navbar-nav {
display: inline-block;
float: none;
}
.navbar .navbar-collapse {
text-align: center;
}
Still have to center the hamburger in the nav and (optionally) get rid of the outline around it. Still lookin for help <3
I've tried switching to 3.0.0, but everything gets screwed up :(
The only thing you're missing is a text-center on your navbar-header.
<div class="navbar-header text-center">
See this Fiddle
It looks like the border around the hamburger is already gone with your CSS
---- Update ----
This is how it looks on mine?
https://jsfiddle.net/DTcHh/35997/
Image of text centered:

CSS float behaving mysteriously

I'm using Bootstrap 3 to create a mobile responsive website.
There are two top level menus on my webpage. Top menu has a ul floated to right and the menu below that has two components: a ul floated left and a search box floated right.
Although float: right is working on the search box, it is not moving to extreme right as it should; instead it leaves some space from right. I haven't applied any right margin to the search box.
However, when I remove float from the top menu's ul (.settings-menu ul), the search box moves to extreme right. The two menus are in different divs. I can't understand why this is happening. Can someone explain why this happening and recommend a solution? My code is as follows:
<div class="settings-menu"> <!-- Top settings/registration panel -->
<ul>
<li><a>Register</a></li>
<li><a>LogIn</a></li>
<li><a>Wishlist(0)</a></li>
<li><a>My Account</a></li>
</ul>
</div>
<nav class="navbar">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#menu-collapse">
<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="menu-collapse">
<ul class="nav navbar-nav">
<li>Home Page</li>
<li>Shop by category</li>
<li>Designers</li>
<li>Blog</li>
<li>Contact Us</li>
</ul>
<form class="navbar-form" role="search">
<label for="id_search"></label>
<input type="text" id="id_search" class="form-control" name="search_item" placeholder="Search Store">
<button type="submit" name="search_button" id="id_search_button" class="search-button"></button>
</form>
</div><!-- /.navbar-collapse -->
</nav>
CSS:
body {
font-family: arial;
font-size: 12px;
background: url("images/texture_2.jpg")
}
.settings-menu {
background-color: #E87772;
border-bottom: 4px solid #F1ADAA;
height: 36px;
}
.settings-menu ul {
float: right;
width: auto;
margin-right: 5%;
}
.settings-menu ul li{
display: inline-block;
padding: 5px;
list-style: none;
}
.settings-menu ul li a{
color: #fff;
font-size: 14px;
}
nav {
background-color: #fff;
width: 100%;
}
nav ul {
float: left;
}
.navbar-nav > li { /*over-riding bootstrap's classes */
display: inline-block;
padding: 7px;
margin-right: 7px;
}
.navbar-nav > li > a{
font-size: 16px;
color: rgb(80,80,80);
padding: 0px;
padding-bottom: 7px;
}
.navbar-nav > li > a:hover{
background-color: #fff;
}
.navbar-nav > li > a:after{
background: none repeat scroll 0 0 #e87772;
bottom: 0;
content: " ";
height: 2px;
left: 50%;
position: absolute;
transition: all 0.25s ease-in-out 0s;
width: 0;
}
.navbar-nav > li > a:hover:after, .navbar-nav > li > a:focus:after {
left: 0;
width: 100%;
}
.navbar-form {
float: right;
display: inline-block;
margin-top: 0;
width: 285px;
height: 45px;
}
.navbar-form .search-button {
background: url("images/icon-search-button.png") no-repeat;
border-radius: 100%;
background-color: #E87772;
height: 38px;
width: 38px;
background-position: center;
border: none;
transition-property: height, width;
transition-duration: 50ms;
transition-timing-function: ease-in-out;
}
.navbar-form .search-button:hover {
height: 40px;
width: 40px;
}
.navbar-form .cart-button {
background: url("images/icon-cart-link.png") no-repeat;
border-radius: 100%;
background-color: #E87772;
height: 38px;
width: 38px;
background-position: center;
border: none;
transition-property: height, width;
transition-duration: 50ms;
transition-timing-function: ease-in-out;
}
.navbar-form .cart-button:hover {
height: 40px;
width: 40px;
}
#id_search { /* for text-box */
border-radius: 0px;
border-right: none;
border-left: none;
border-top: 1px solid #DDDDDD;
border-bottom: 1px solid #DDDDDD;
box-shadow: none;
margin-top: 5px;
}
#search-box {
float: right;
}
.navbar-collapse.collapse have default padding by bootstrape. try this Demo
.navbar-collapse.collapse{
padding-right :0 !important;
}