CSS : button overlapped by a div,z-index not working - html

I have a top bar with a button and a navbar, for z-index reason I can only get the button working but the menu hided under the top bar or I get both but the button not clickable:
PS: I get this problem only on small display with the burger menu,
For the small device, Bootstrap uses this:
.navbar-fixed-top, .navbar-fixed-bottom {
position: fixed;
right: 0;
left: 0;
z-index: 1030;
}
If I override Z-index:1030; the bergur menu is hided under my headercss bar.
Here is my almost whole CSS, maybe some parts are not important for my problem:
HTML:
<div class="headercss navbar-fixed-top">
<div class="element"> <a class="btn btn-warning" href="www.test.com">Internet ></a></div>
</div>
<div class="sidebar-nav">
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="navbar-collapse collapse sidebar-navbar-collapse" data-toggle="collapse" data-target=".navbar-collapse">
<ul class="nav navbar-nav">
<li>test</li>
<li>test</li>
<li>test</li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
CSS:
.headercss {
width: 100%;
height: 62px;
display:block;
overflow:auto;
background-color: #CAD722;
top: -1px;
left: 0px;
position: fixed;
z-index: 100;
}
}
.btn {
font-size: 18px;
font-weight: bold;
}
/* make sidebar nav vertical */
.navbar-default .navbar-nav>li>a {
font-weight: bold;
}
#media (min-width: 768px) {
.navbar-default{
width: 200px;;
height: 100%;
background-color: #e6dfd7;
z-index: 0;
}
.sidebar-nav .navbar .navbar-collapse {
margin-top: 65px;
padding: 0;
max-height: none;
}
.sidebar-nav .navbar ul {
float: none;
display: block;
}
.sidebar-nav .navbar li {
float: none;
display: block;
}
.sidebar-nav .navbar li a {
padding-top: 12px;
padding-bottom: 12px;
font-size: 16px;
}
.sidebar-nav .navbar li a:hover {
background-color: #CAD722;
}
}
/*fixing bootstrap*/
.col-sm-10 {
width: 100%;
float: right;
}
#media (min-width: 768px){
.col-sm-10 {
width: 85%;
}
}
.navbar-default .navbar-collapse,.navbar-default .navbar-form {
border-color:#CAD722;
}
.content{
position: relative;
}
.navbar-toggle {
margin-top: 11px;
margin-bottom: 1px;
margin-left: 5px;
float: left;
}
/*For small display*/
#media (max-width: 768px) {
.navbar-default {
background-color: transparent;
border-color: transparent;
}
.sidebar-nav .navbar li{
background-color: #CAD722;
}
}

The issue is that you essentially have two full-width navbars sitting on top of each other, with one button in each. Clearly, you'll only be able to click on the top one. One solution is to add width: 50%; to .navbar-default and width: 200%; to .navbar-collapse in the small display; This causes the navbar with the menu button to only cover half of the screen, allowing you to click on the Internet button, while the collapsible menu remains full-width.

Related

How do I keep the logo from resizing when on mobile?

I believe what is happening is the image is getting shrinked until it disappears, and I want to keep it the same size even on mobile, and also leveled to the rest of the nav li/hamburger
<!DOCTYPE html>
<head>
</head>
<body>
<style>
/* --- header -- */
.navbar-header div.logo {
margin-top: -1%;
padding-bottom: 0;
}
.navbar-header div.logo a.navbar-brand {
padding: 0;
}
.navbar-header div.logo a.navbar-brand img {
width: 6%;
padding: 15px;
}
navbar-nav .navbar-brand {
display: flex;
align-items: center;
}
.navbar-nav .navbar-brand>img {
padding: 7px 14px;
}
/****override navbar height********/
.navbar-nav > li > a {
padding-top: 4px !important;
padding-bottom: 2px !important;
}
.navbar {
min-height: 5px !important
}
/*********************************/
header .navbar {
margin-bottom: 0;
}
.navbar-default {
border: none;
}
header .navbar-collapse ul.navbar-nav {
float: right;
margin-right: 0;
}
header .navbar-default {
background-color: transparent;
}
header .navbar {
min-height: 32px;
}
header .navbar-nav > li {
padding-bottom: 5px;
padding-top: 5px;
}
header .navbar-nav > li > a {
padding-bottom: 5px;
padding-top: 5px;
margin-left: 2px;
line-height: 30px;
font-weight: 700;
}
</style>
<header>
<div class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="logo">
<a class="navbar-brand" href="index.php"><img src="./img/logo.png"></a>
</div>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>about us</li>
<li>Contacts</li>
</ul>
</div>
</div>
</div>
</header>
<div>content</div>
</body>
Does anyone know how to keep the logo from disappearing, moving or resizing, while keeping the rest of the website elements responsive?
It's because you have set your image to a size in %, you will have to change it to a set size. This:
.navbar-header div.logo a.navbar-brand img {
width: 6%;
padding: 15px;
}
should be something like this:
.navbar-header div.logo a.navbar-brand img {
width: 200px;
padding: 15px;
}

Bootstrap Navbar overflows and breaks links when overflow is hidden

I have a bootstrap navbar that overflows on mobile, when I set my css to hide the overflow, the button links break. I am at a total loss. Here is my navbar code. Here is a link to the site. I would love if anyone has the opportunity to help thanks.
HTML
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button id="btnCollapse" 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>
<h1 class="navbar-brand">Goode Development</h1>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav navbar-left">
<li><a class="a" href="#homey">Home</a></li>
<li><a class="a" href="#porty">Portfolio</a></li>
<li><a class="a" href="#abouty">About</a></li>
<li><a class="a" href="#conty">Contact</a></li>
</ul>
</div>
</div>
</nav>
CSS
.navbar {
height: 125px;
background-color:#0d0d0d !important;
}
.navbar-brand {
position: relative!important;
left: 45px!important;
bottom: 10px!important;
font-size: 4em!important;
color: white!important;
font-family: "Montserrat", sans-serif !important;
white-space:nowrap;
}
.nav.navbar-nav.navbar-left li a {
color: white;
position: relative;
right: 475px;
top: 66px;
font-family: "Montserrat", sans-serif !important;
}
.nav.navbar-nav.navbar-left li a:hover {
color: orange;
}
#myNavbar {
background-color: #0d0d0d ;
}
#media screen and (max-width: 990px) {
.navbar-header {
float: none !important;
}
.navbar-brand {
left: 0 !important;
}
.nav li a {
padding: 5px;
margin-right: 50px;
}
.nav.navbar-nav.navbar-left li a {
color: white;
right: 0px;
top: 0px;
}
}
#media screen and (max-width: 767px) {
.navbar-brand {
font-size: 40px !important;
position: relative !important;
top: -20px !important;
left: -10px !important;
}
.navbar {
height: 70px;
}
.nav.navbar-nav.navbar-left li a {
color: #0d0d0d;
right: 0;
top: 0;
}
.navbar-collapse{
overflow-x:hidden;
}
.collapsing,
.in {
background-color: #222222;
position: relative;
top: -30px;
}
.collapsing ul li a,
.in ul li a {
color: white!important;
}
.collapsing ul li a:hover,
.in ul li a:hover {
color: orange!important;
}
}
You need to adjust you're viewport meta tag for flawless responsive display.
You're currently having:
<meta name="viewport" content="width=device-width, initial-scale=1">
Adding of minimum, maximum scale, and the user scalability to the meta tag will fix your problem.
Try this:
<meta name="viewport" content="initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0,width=device-width" />

bootstrap collapse menu has 2 rows

I am building this website
torgoborudovanie.com
I have a collapsing navbar build with bootstrap.But when I try to resize the window I get something like this :
As you can see (and you can actually try it ) nav bar now has 2 lines and it looks wired (the actual problem is that it looks like this on Iphone and Ipad) Then you can resize it a little bit more and it gets collapsed as I want.
You can see the code by simply viewing html code in developer tools.
So I will not post it here to make qustion clean and small.But if you want I can post the code here too=)
I ended up with this (quite shitty to be fair workaround)
On page load if I have window.width less than 1200px I just hide long text.
function hideSlogan() {
if($(window).width() <1200) {$('.slogan').hide()}
};
hideSlogan();
Go to the CSS rules starting at the MOBILE NAV comment; these are the rules you can adjust to make the navbar collapse at different breakpoints.
On a sidenote, there is one extra, broken list tag in the nav and with the positioning of Надежный партнер - качественные решения! inside your navbar-collapse div you'll the following behavior:
If you expand the menu when it's in the mobile and then expand the viewport your navbar will revert to the line-height: 60px unless the browser is refreshed. Might not matter but since you're trying to change the collapse breakpoint it's worth mentioning.
**I also moved the inline styles with the rest of the CSS Rules.
#import url(http://fonts.googleapis.com/css?family=Open+Sans:400, 700, 800);
#import url(http://fonts.googleapis.com/css?family=Libre+Baskerville:400italic);
* {
margin: 0;
padding: 0px;
font-family: 'Open Sans', sans-serif;
}
body {
background: #fff;
margin: 0;
color: #42413e;
padding-top: 50px;
}
/* BOOTSTRAP MODIFICATION */
.navbar-right a .btn-orange {
margin-top: -5px;
}
.btn-orange {
background: #f27242;
border-radius: 2px;
color: white;
font-size: 12px;
font-weight: 700;
}
.btn-orange:hover {
background: #e16a3e;
color: white;
}
.navbar-default .navbar-brand {
height: 50px;
padding: 10px 15px;
font-size: 20px;
line-height: 22px;
font-weight: 700;
}
.navbar.navbar-default {
background-color: #ffffff;
border-color: #e7e7e7;
}
.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
color: #f27242;
background-color: transparent;
}
.navbar-default .navbar-nav > li > a {
color: #ccc;
}
.navbar-default .navbar-right {
padding-top: 5px
}
.navbar-default li.dropdown a {
color: black;
}
.navbar-default span.head-title {
line-height: 60px;
}
.navbar-default .navbar-right .dropdown-menu {
right: auto;
left: 0;
}
.navbar-right li.contact-info a {
color: #42413e;
}
/****MOBILE NAVBAR******/
#media (max-width: 1200px) {
.custom-navbar .navbar-header {
float: none;
}
.custom-navbar .navbar-left,
.custom-navbar .navbar-right {
float: none !important;
}
.custom-navbar .navbar-toggle {
display: block;
}
.custom-navbar .navbar-collapse {
border-top: 1px solid transparent;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
overflow-x: hidden;
}
.custom-navbar.navbar-fixed-top {
top: 0;
border-width: 0 0 1px;
}
.custom-navbar .navbar-collapse.collapse {
display: none!important;
}
.custom-navbar .navbar-nav {
float: none!important;
margin-top: 7.5px;
}
.custom-navbar .navbar-nav > li {
float: none;
}
.custom-navbar .navbar-nav > li > a {
padding-top: 10px;
padding-bottom: 10px;
}
.custom-navbar .collapse.in {
display: block !important;
}
.custom-navbar .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;
}
.custom-navbar .navbar-brand {
height: 55px;
padding: 10px 15px;
font-size: 20px;
line-height: 22px;
font-weight: 700;
}
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" rel="stylesheet" />
<nav class="navbar navbar-default custom-navbar navbar-fixed-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">Переключить навигацию</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">
<img src="http://www.torgoborudovanie.com/assets/img/logo1.png" width="140">
</a>
</div>
<div class="collapse navbar-collapse"><span class="head-title">Надежный партнер - качественные решения!</span>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown"> Каталог <span class="caret"></span>
<ul class="dropdown-menu">
<li>Стеллажи
</li>
<li>Торговая мебель
</li>
<li>Тележки и корзины
</li>
<li> Кассовые боксы
</li>
<li>Холодильное оборудование
</li>
<li role="separator" class="divider"></li>
<li>Условия доставки
</li>
</ul>
</li>
<li class="contact-info">
<i class="fa fa-phone "></i> 8 (343) 3448090
</li>
<li class="contact-info">
<i class="fa fa-envelope"></i> info#optimagp.ru
</li>
<li>
<a href="#f">
<button class="btn btn-sm btn-orange" type="button">Заказать звонок</button>
</a>
</li>
</ul>
</div>
</div>
</nav>
you need to change your breakpoint, when the navbar gets collapsed...
so for example, this should work:
#media only screen and (min-width: 1200px) {
.collapse {
display: block;
}
.navbar-toggle {
display: none;
}
}
#media only screen and (max-width: 1200px) {
.collapse {
display: none;
}
.navbar-toggle {
display: block;
}
}
because it floats (because its so long) after 1200px width...
** sorry, i made a mistake... try it now :) **

How to make responsive navbar?

Here is my navbar:
<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="#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" href="/"><img src="/img/logo.png"></a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active">LONG<br>ITEM1</li>
<li>LONG<br>ITEM 2</li>
<li>LONG<br>ITEM 3</li>
<li>LONG<br>ITEM 4</li>
<li>LONG<br>ITEM 5</li>
</ul>
</div>
</div>
</nav>
and css:
.navbar {
min-height: 100px;
font-family: 'Roboto Condensed', sans-serif;
font-size: 25px;
margin-bottom: 0px;
padding: 0px 70px;
}
.navbar-brand>img {
height: 70px;
}
.navbar-brand {
padding-top: 15px;
padding-bottom: 15px;
}
.navbar-default {
background: #5aa0d1;
border-radius: 0;
-webkit-box-shadow: none;
-box-shadow: none;
border: 0;
}
.navbar-default .navbar-brand {
color: #fff14f;
}
.navbar-default .navbar-nav > li > a {
color: #fff14f;
line-height: 24px;
padding-top: 28px;
}
.navbar-default .navbar-nav>li.active>a {
color: #ffffff;
background-color: transparent;
}
.navbar-default .navbar-nav>.active>a, .navbar-default .navbar-nav>.active>a:focus, .navbar-default .navbar-nav>.active>a:hover {
color: #ffffff;
background-color: transparent;
}
.navbar-default .navbar-nav>li>a:focus, .navbar-default .navbar-nav>li>a:hover {
color: #ffffff;
}
It doesn't displayed well on small devices (iPad, iPhone, Android devices) - some navbar elements overlay others (see real example at vkko.ru).
What is wrong there? How should I fix that?
I can see two issues here since you are not specifying what exactly you want fixed.
The logo is too big for an xs screen and the divider overlays the logo when you open the burger menu. I noticed you are using an image for a logo hence you don't really need to use the navbar-brand since that class adds unnecessary css for text based logos, you can simply use pull-left class.
<a class="pull-left" href="/"><img src="/img/logo.png"></a>
The other one is the font-size is too large and hence pushes the list of links to the next line when on smaller devices. You can use "media queries" to detect when a user is on a smaller device and adjust the font-size accordingly and I have used the css solution from this answer to fix your issue.
I have made a pen to help you visualise everything mentioned above. Hope it helps. http://codepen.io/anon/pen/PqEmgP
I've created a responsive navbar using only CSS,JS and JQuery. No additional library/plugins required.
Added animation on close, open navbar on mobile view.
Added animated hamburger menu.
You can checkout the demo+code here: https://codepen.io/jerrygoyal/pen/XEZvgG
HTML:
<nav class="navbar-menu">
<a class="nav-homepage">
JerryGoyal
</a>
<div class="nav-menu-select">
<a class="nav-hamburger">
<div class="hamburger bar1"></div>
<div class="hamburger bar2"></div>
<div class="hamburger bar3"></div>
</a>
</div>
<ul class="nav-menu-options">
<li>
<a>Apps</a>
</li>
<li>
<a>About Me</a>
</li>
<li>
<a>Contact</a>
</li>
</ul>
</nav>
JS:
$(document).ready(function () {
initNavbar();
});
function initNavbar(){
// 0 = hide, 1 = visible
var menuState = 0;
/* Add a Click event listener to btn-select */
$(".nav-hamburger").on("click",function() {
$(this).toggleClass('change');
if(menuState === 0) {
$(".nav-menu-options").slideDown("slow");
menuState = 1;
} else {
$(".nav-menu-options").slideUp("slow");
menuState = 0;
}
});
}
CSS:
/*****************************************************
NAV BAR START
*****************************************************/
.navbar-menu {
background-color: #005ec8;
width: calc(100%);
height: 55px;
}
.navbar-menu a{
color: #ffffff;
text-decoration: none;
font-size: 17px;
cursor: pointer;
}
.navbar-menu a:hover {
background-color: #fff;
color: #005ec8;
}
.nav-menu-options li a {
display: block;
padding: 18px;
}
.nav-homepage{
display: inline-block;
font-weight: bold;
font-size: 20px !important;
letter-spacing: 1px;
position: absolute;
z-index: 1;
padding: 17px;
}
.nav-menu-select {
margin: 0;
text-align: right;
height: inherit;
}
.nav-hamburger{
display: inline-block;
padding: 13px;
}
.nav-menu-options {
display: block;
text-align: right;
width: 100%;
margin: 0px;
padding: 0px;
background-color: inherit;
}
/* DESKTOP */
#media screen and (min-width: 750px) {
.nav-menu-select{
display: none;
}
.nav-menu-options{
display: block !important;
border-bottom: 0;
}
.nav-menu-options li{
display: inline-block;
}
}
/* MOBILE */
#media screen and (max-width: 750px) {
.navbar-menu {
margin: 0;
}
.nav-menu-options {
display: none;
position: relative;
text-align: center;
}
.nav-menu-options li{
display: block;
}
}
.hamburger {
width: 25px;
height: 2px;
background-color: currentColor;
margin: 6px 0;
transition: 0.4s;
}
.nav-hamburger:before{
content: "";
position: absolute;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
width: 40px;
height: 40px;
border: 2px solid transparent;
top: 8px;
right: 4px;
border-radius: 100%;
-webkit-transition: all 0.4s ease-in-out;
-o-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
z-index: 1;
}
.nav-hamburger.change:before{
border: 2px solid currentColor;
}
.change .bar1 {
-webkit-transform: rotate(-45deg) translate(-4px, 7px);
transform: rotate(-45deg) translate(-4px, 7px);
}
.change .bar2 {opacity: 0;}
.change .bar3 {
-webkit-transform: rotate(45deg) translate(-4px, -7px);
transform: rotate(45deg) translate(-4px, -7px);
}
/*****************************************************
NAV BAR END
*****************************************************/
body{
background-color:#ffa700;
margin:0
}
you can use something like this:
#media screen and (max-width: 1024px) {}
and set custom rules for custom devices, I know its more of hardwork and not smartwork but it's more precise and trustable than using vw or vh
I made a responsive navbar with dropdown menu interactive with content.
if interested you can check it out!
https://youtu.be/0yF6ulcW7h0

Fixing ul to right of bootstrap navbar

Disclaimer: Pardon my stupidity when it comes to coding. I started learning last week.
I have been tinkering around with a Bootstrap 3 template from a Youtube tutorial I found to assist me in learning HTML, CSS, and eventually Java. In this example I'm working on, I am trying to get the inline unordered list to float to the right of the page. I tried adding float:right to most of the navbar elements in the CSS, but it's not doing anything for me. Any help would be greatly appreciated.
HTML:
<div class="navbar navbar-fixed-top">
<div class="container">
<!-- .btn-navbar is used as the toggle for collapsed navbar content -->
<button class="navbar-toggle" data-target=".navbar-responsive-collapse" 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" href="/"><img src="images/logo.png" alt="Your Logo"></a>
<div class="nav-collapse collapse navbar-responsive-collapse">
<ul class="nav navbar-nav">
<li class="active">
Home
</li>
<li class="inactive">
Photos
</li>
<li class="inactive">
Videos
</li>
<li class="inactive">
Contact Us
</li>
</ul>
</div><!-- end nav-collapse -->
</div><!-- end container -->
</div><!-- end navbar -->
CSS:
.navbar {
position: relative;
min-height: 50px;
padding-right: 15px;
padding-left: 15px;
margin-bottom: 20px;
background-color: #eeeeee;
border-radius: 4px;
}
.navbar:before,
.navbar:after {
display: table;
content: " ";
}
.navbar:after {
clear: both;
}
.navbar:before,
.navbar:after {
display: table;
content: " ";
}
.navbar:after {
clear: both;
}
.navbar-nav {
margin-top: 10px;
margin-bottom: 15px;
}
.navbar-nav > li > a {
padding-top: 15px;
padding-bottom: 15px;
line-height: 20px;
color: #777777;
border-radius: 4px;
}
.navbar-nav > li > a:hover,
.navbar-nav > li > a:focus {
color: #333333;
background-color: transparent;
}
.navbar-nav > .active > a,
.navbar-nav > .active > a:hover,
.navbar-nav > .active > a:focus {
color: #555555;
background-color: #d5d5d5;
}
.navbar-nav > .disabled > a,
.navbar-nav > .disabled > a:hover,
.navbar-nav > .disabled > a:focus {
color: #cccccc;
background-color: transparent;
}
.navbar-nav.pull-right {
width: 100%;
}
.navbar-static-top {
border-radius: 0;
}
.navbar-fixed-top,
.navbar-fixed-bottom {
position: fixed;
right: 0;
left: 0;
z-index: 1030;
border-radius: 0;
}
.navbar-fixed-top {
top: 0;
}
.navbar-fixed-bottom {
bottom: 0;
margin-bottom: 0;
}
.navbar-brand {
display: block;
max-width: 200px;
padding: 15px 15px;
margin-right: auto;
margin-left: auto;
font-size: 18px;
font-weight: 500;
line-height: 20px;
color: #777777;
text-align: center;
}
.navbar-brand:hover,
.navbar-brand:focus {
color: #5e5e5e;
text-decoration: none;
background-color: transparent;
}
.navbar-toggle {
position: absolute;
top: 9px;
right: 10px;
width: 48px;
height: 32px;
padding: 8px 12px;
background-color: transparent;
border: 1px solid #dddddd;
border-radius: 4px;
}
.navbar-toggle:hover,
.navbar-toggle:focus {
background-color: #dddddd;
}
.navbar-toggle .icon-bar {
display: block;
width: 22px;
height: 2px;
background-color: #cccccc;
border-radius: 1px;
}
.navbar-toggle .icon-bar + .icon-bar {
margin-top: 4px;
}
As you are using Bootstrap, to so you may use class .pull-right to align it to right.
For more info click here.
In Bootstrap v 3.** it is better practice to use "navbar-right" so the proper context should read:
ul class = "nav navbar-nav navbar-right"
If you are using bootstrap 3 the use navbar-right to pull right h
jsfiddle.net/makk/9yxeg7r5/2 - this is a similar example
<div id="top"></div>
<div class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="row">
<div class="navbar-header">
<a class="navbar-brand" href="#top"><span class="fa fa-book fa-3x">MATH</span></a>
</div>
<ul class="nav navbar-nav navbar-right">
<li>Home</li>
<li>Features</li>
<li>Courses</li>
<li>Pricing</li>
<li>Contact</li>
</ul>
</div>
</div>
</div>