Cannot Hide Submenu on Bootstrap 3x - html

I'm new in website development. I have some problem that I cant's solve myself. for your information I'have used template from Zerotheme. Here the link you can download to view the full source code.
Q > How to hide the second level because I want to use "Hover" on the Submenu.
Screenshot
Can someone help me to solve this.
#menu {
border-radius: 0;
text-transform: uppercase;
background: #fff;
}
body.sub-page #menu {
padding: 10px 0;
}
#menu.navbar {
margin: 0;
min-height: auto
}
#menu #heading {
float: left;
padding-left: 15px;
font-size: 20px;
font-weight: 700;
line-height: 40px;
color: #fff;
margin-top: 10px;
text-transform: uppercase;
}
#menu .navbar-brand {
margin: 0;
height: auto;
padding: 0px 18px;
}
#menu .navbar-brand img {
max-width: 160px;
}
#menu .logo {}
#menu .dropdown-menu {
background-color: #EDD9C0;
border: none;
border-radius: 0;
}
#menu ul.nav .dropdown-menu li a {
color: #1a1c1e;
}
#menu ul.nav .dropdown-menu li a:hover {}
#menu .dropdown-inner {
display: table;
}
#menu .dropdown-inner ul {
display: table-cell;
}
#menu .dropdown-inner a {
min-width: 160px;
display: block;
padding: 3px 20px;
clear: both;
line-height: 20px;
color: #000;
margin: 0 5px;
}
#menu li.dropdown:hover>a,
#menu li.dropdown:focus>a,
#menu li.dropdown:active>a {
color: #3B3A36;
background: none;
}
#menu ul.nav li {
padding-right: 16px;
}
#menu ul.nav li a {
padding: 8px 10px;
color: #333;
font-size: 14px;
font-weight: bold;
}
#menu ul.nav li.dropdown a {}
#menu .nav>li>a:hover,
#menu .nav>li>a:focus {
color: #3B3A36;
background: none;
}
#menu .btn-navbar {
font-size: 20px;
color: #FFF;
padding: 5px 15px;
float: right;
border: 3px solid #fff;
}
#media (min-width: 768px) {
#menu ul.nav.navbar-nav {
margin-top: 5px;
display: inline-block;
float: none;
}
#menu .dropdown:hover .dropdown-menu {
display: block;
}
#menu .navbar-collapse {
text-align: center;
}
body.sub-page #menu ul.nav.navbar-nav {
margin-top: 5px;
display: block;
float: right;
}
}
#media(max-width:767px) {
#menu {
background: #1D2027;
padding: 10px 0;
}
#menu .navbar-brand {
display: block;
color: #fff;
margin-top: 10px;
}
#menu div.dropdown-inner>ul.list-unstyled {
display: block;
}
#menu .dropdown-inner a {
width: 100%;
color: #fff;
}
#menu div.dropdown-menu {
margin-left: 0 !important;
padding-bottom: 10px;
background-color: rgba(0, 0, 0, 0.1);
}
#menu ul.nav li a {
color: #fff;
}
#menu ul.nav li a:hover {
color: #EDD9C0;
}
#menu ul.nav li.dropdown a {
color: #fff;
}
}
.dropdown-submenu {
position: relative;
}
.dropdown-submenu>.dropdown-menu {
top: 0;
left: 100%;
margin-top: -6px;
margin-left: -1px;
-webkit-border-radius: 0 6px 6px 6px;
-moz-border-radius: 0 6px 6px 6px;
border-radius: 0 6px 6px 6px;
}
.dropdown-submenu:hover>.dropdown-menu {
display: block;
}
.dropdown-submenu>a:after {
display: block;
content: " ";
float: right;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-width: 5px 0 5px 5px;
border-left-color: #cccccc;
margin-top: 5px;
margin-right: -10px;
}
.dropdown-submenu:hover>a:after {
border-left-color: #ffffff;
}
.dropdown-submenu.pull-left {
float: none;
}
.dropdown-submenu.pull-left>.dropdown-menu {
left: -100%;
margin-left: 10px;
-webkit-border-radius: 6px 0 6px 6px;
-moz-border-radius: 6px 0 6px 6px;
border-radius: 6px 0 6px 6px;
}
<!--Navigation-->
<nav id="menu" class="navbar">
<div class="container-fluid">
<div class="navbar-header">
<span id="heading" class="visible-xs">Categories</span>
<button type="button" class="btn btn-navbar navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse"><i
class="fa fa-bars"></i></button>
</div>
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav">
<li class="active">Home</li>
<li>About Us</li>
<li class="dropdown">Category <i class="fa fa-chevron-down"></i>
<div class="dropdown-menu">
<div class="dropdown-inner">
<ul class="list-unstyled">
<li>Text 301</li>
<li>Text 302</li>
<li>Text 303</li>
<li>Text 304</li>
<li>Text 305</li>
<li class="dropdown-submenu"><a tabindex="-1" href="#">Text 314</a>
<ul class="dropdown-menu">
<li>Second level</li>
<li>Second level</li>
</ul>
</li>
</ul>
</div>
</div>
</li>
<li>Blog</li>
<li>Contact</li>
</ul>
</div>
</div>
</nav>

First of all change css of
#menu .dropdown:hover .dropdown-menu {display: block;}
to
#menu .dropdown:hover>.dropdown-menu {display: block;}
because on hover of dropdown show both dropdown-menu and remove
#menu .dropdown-inner {display: table;}
#menu .dropdown-inner ul {display: table-cell;}
because its override display:none without hover
#menu {border-radius: 0;text-transform: uppercase;background: #fff;}
body.sub-page #menu {padding: 10px 0;}
#menu.navbar{margin: 0;min-height:auto}
#menu #heading {float: left;padding-left: 15px;font-size: 20px;font-weight: 700;line-height: 40px;color: #fff;margin-top: 10px;text-transform: uppercase;}
#menu .navbar-brand{margin: 0;height: auto;padding: 0px 18px;}
#menu .navbar-brand img{max-width: 160px;}
#menu .logo {}
#menu .dropdown-menu {background-color: #EDD9C0;border:none;border-radius: 0;}
#menu ul.nav .dropdown-menu li a{color: #1a1c1e;}
#menu ul.nav .dropdown-menu li a:hover{}
#menu .dropdown-inner a {min-width: 160px;display: block;padding: 3px 20px;clear: both;line-height: 20px;color: #000;margin: 0 5px;}
#menu li.dropdown:hover>a, #menu li.dropdown:focus>a, #menu li.dropdown:active>a{color: #3B3A36;background: none;}
#menu ul.nav li{padding-right: 16px;}
#menu ul.nav li a{padding: 8px 10px;color: #333;font-size: 14px;font-weight: bold;}
#menu ul.nav li.dropdown a{}
#menu .nav > li > a:hover, #menu .nav > li > a:focus{color:#3B3A36;background: none;}
#menu .btn-navbar {font-size: 20px;color: #FFF;padding: 5px 15px;float: right;border: 3px solid #fff;}
#media (min-width: 768px) {
#menu ul.nav.navbar-nav {margin-top: 5px;display: inline-block;float: none;}
#menu .dropdown:hover>.dropdown-menu {display: block;}
#menu .navbar-collapse {text-align: center;}
body.sub-page #menu ul.nav.navbar-nav {margin-top: 5px;display: block;float: right;}
}
#media(max-width:767px) {
#menu{background: #1D2027;padding: 10px 0;}
#menu .navbar-brand {display: block;color: #fff;margin-top: 10px;}
#menu div.dropdown-inner > ul.list-unstyled {display: block;}
#menu .dropdown-inner a {width: 100%;color: #fff;}
#menu div.dropdown-menu {margin-left: 0 !important; padding-bottom: 10px;background-color: rgba(0, 0, 0, 0.1);}
#menu ul.nav li a{color: #fff;}
#menu ul.nav li a:hover{color: #EDD9C0;}
#menu ul.nav li.dropdown a{color: #fff;}
}
.dropdown-submenu{position:relative;}
.dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px;}
.dropdown-submenu:hover>.dropdown-menu{display:block;}
.dropdown-submenu>a:after{display:block;content:" ";float:right;width:0;height:0;border-color:transparent;border-style:solid;border-width:5px 0 5px 5px;border-left-color:#cccccc;margin-top:5px;margin-right:-10px;}
.dropdown-submenu:hover>a:after{border-left-color:#ffffff;}
.dropdown-submenu.pull-left{float:none;}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px;}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<!--Navigation-->
<nav id="menu" class="navbar">
<div class="container-fluid">
<div class="navbar-header">
<span id="heading" class="visible-xs">Categories</span>
<button type="button" class="btn btn-navbar navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse"><i class="fa fa-bars"></i></button>
</div>
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav">
<li class="active">Home</li>
<li>About Us</li>
<li class="dropdown">Category <i class="fa fa-chevron-down"></i>
<div class="dropdown-menu">
<div class="dropdown-inner">
<ul class="list-unstyled">
<li>Text 301</li>
<li>Text 302</li>
<li>Text 303</li>
<li>Text 304</li>
<li>Text 305</li>
<li class="dropdown-submenu"><a tabindex="-1" href="#">Text 314</a>
<ul class="dropdown-menu">
<li>Second level</li>
<li>Second level</li>
</ul>
</li>
</ul>
</div>
</div>
</li>
<li>Blog</li>
<li>Contact</li>
</ul>
</div>
</div>
</nav>

Related

Create a sub menu html

Hey i have quite a bit of a design to my dropdown menu and im having trouble adding a submenu to lets say to the first element on the dropdown-cotent div.
I simply want the sub menu to start where the hover of the submeneu is defined and to the right and drop down the same way as my current sub menu does it.
Here is my html:
<nav>
<div class="main-nav">
<ul class="left">
<li class="dropdown">Home
<div class="dropdown-content">
Third
Third Link
Third Link 3
</div>
</li>
<li>Gods</li>
<li>Goddesses</li>
</ul>
<div class="play-now"></div>
<ul class="right">
<li>Heroes</li>
<li>Myths</li>
<li>Beasts</li>
</ul>
</div>
</nav>
And here is the css to it all:
nav {
padding-left: 5px
}
nav .main-nav {
height: 80px;
width: 100%;
margin-top: 64px;
background: url(../images/navHeader.png) no-repeat top;
position: relative
}
nav .main-nav ul {
width: 360px;
height: 80px;
margin-top: 2px;
padding: 0;
list-style-type: none
}
nav .main-nav ul a,
nav .main-nav ul li {
display: inline-block;
width: 105px;
line-height: 80px;
height: 80px
}
nav .main-nav .dropdown-content a {
height: auto;
line-height: initial;
padding: 3px 0;
}
nav .main-nav ul a {
text-align: center;
font-weight: 550;
font-size: 12px;
color: #84827d;
text-shadow: 1px 1px 1px 1px #000;
text-transform: uppercase;
-webkit-transition: all .2s ease-in-out;
transition: all .2s ease-in-out
}
nav .main-nav ul a:hover {
text-decoration: none;
color: #7289da
}
nav .main-nav li .dropdown {
}
nav .main-nav .dropdown-content {
position: absolute;
display: none;
float: left;
z-index: 10;
-webkit-box-shadow: 0 3px 5px 0 #999;
-moz-box-shadow: 0 3px 5px 0 #999;
box-shadow: 0 3px 5px 0 #999;
border: 1px solid #CCC;
background: #3A4FC5;
color: #656161;
opacity: .8;
min-width: 30px;
top: 60px;
}
nav .main-nav .dropdown-content a {
color: black;
text-decoration: none;
display: block;
text-align: center;
}
nav .main-nav .dropdown-content a:hover {
background-color: #3A4FC5
}
nav .main-nav .dropdown:hover .dropdown-content {
display: inline-block;
}
nav .main-nav ul.left {
float: left;
margin-left: 5px;
}
nav .main-nav ul.right {
float: right;
margin-left: 5px
}
Here is snippet,
nav {
padding-left: 5px
}
nav .main-nav {
height: 80px;
width: 100%;
margin-top: 64px;
background: url(../images/navHeader.png) no-repeat top;
position: relative
}
nav .main-nav ul {
width: 360px;
height: 80px;
margin-top: 2px;
padding: 0;
list-style-type: none
}
nav .main-nav ul a,
nav .main-nav ul li {
display: inline-block;
width: 105px;
line-height: 80px;
height: 80px
}
nav .main-nav .dropdown-content a {
height: auto;
line-height: initial;
padding: 3px 0;
}
nav .main-nav ul a {
text-align: center;
font-weight: 550;
font-size: 12px;
color: #84827d;
text-shadow: 1px 1px 1px 1px #000;
text-transform: uppercase;
-webkit-transition: all .2s ease-in-out;
transition: all .2s ease-in-out
}
nav .main-nav ul a:hover {
text-decoration: none;
color: #7289da
}
nav .main-nav li .dropdown {
}
nav .main-nav .dropdown-content {
position: absolute;
display: none;
float: left;
z-index: 10;
-webkit-box-shadow: 0 3px 5px 0 #999;
-moz-box-shadow: 0 3px 5px 0 #999;
box-shadow: 0 3px 5px 0 #999;
border: 1px solid #CCC;
background: #3A4FC5;
color: #656161;
opacity: .8;
min-width: 30px;
top: 60px;
}
nav .main-nav .dropdown-content a {
color: black;
text-decoration: none;
display: block;
text-align: center;
}
nav .main-nav .dropdown-content a:hover {
background-color: #3A4FC5
}
nav .main-nav .dropdown:hover .dropdown-content {
display: inline-block;
}
nav .main-nav ul.left {
float: left;
margin-left: 5px;
}
nav .main-nav ul.right {
float: right;
margin-left: 5px
}
<nav>
<div class="main-nav">
<ul class="left">
<li class="dropdown">Home
<div class="dropdown-content">
Third
Third Link
Third Link 3
</div>
</li>
<li>Gods</li>
<li>Goddesses</li>
</ul>
<div class="play-now"></div>
<ul class="right">
<li>Heroes</li>
<li>Myths</li>
<li>Beasts</li>
</ul>
</div>
</nav>
$(document).ready(function(){
$('.dropdown-submenu a.test').on("click", function(e){
$(this).next('ul').toggle();
e.stopPropagation();
e.preventDefault();
});
});
<style>
.dropdown-submenu {
position: relative;
}
.dropdown-submenu .dropdown-menu {
top: 0;
left: 100%;
margin-top: -1px;
}
</style>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">Dropdown
<span class="caret"></span></button>
<ul class="dropdown-menu">
<li><a tabindex="-1" href="#">HTML</a></li>
<li><a tabindex="-1" href="#">CSS</a></li>
<li class="dropdown-submenu">
<a class="test" tabindex="-1" href="#">New dropdown <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a tabindex="-1" href="#">2nd level dropdown</a></li>
<li><a tabindex="-1" href="#">2nd level dropdown</a></li>
<li class="dropdown-submenu">
<a class="test" href="#">Another dropdown <span class="caret"></span></a>
<ul class="dropdown-menu">
<li>3rd level dropdown</li>
<li>3rd level dropdown</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
</body>
</html>
Did you mean to say this?
nav {
padding-left: 5px
}
nav .main-nav {
height: 80px;
width: 100%;
margin-top: 64px;
background: url(../images/navHeader.png) no-repeat top;
position: relative
}
nav .main-nav > ul {
width: 360px;
height: 80px;
margin-top: 2px;
padding: 0;
list-style-type: none
}
nav .main-nav ul a,
nav .main-nav ul li {
display: inline-block;
width: 105px;
line-height: 80px;
height: 80px
}
nav .main-nav .dropdown-content a {
height: auto;
line-height: initial;
padding: 3px 0;
}
nav .main-nav ul a {
text-align: center;
font-weight: 550;
font-size: 12px;
color: #84827d;
text-shadow: 1px 1px 1px 1px #000;
text-transform: uppercase;
-webkit-transition: all .2s ease-in-out;
transition: all .2s ease-in-out
}
nav .main-nav ul a:hover {
text-decoration: none;
color: #7289da
}
nav .main-nav li .dropdown {
}
nav .main-nav .dropdown-content {
position: absolute;
display: none;
float: left;
z-index: 10;
-webkit-box-shadow: 0 3px 5px 0 #999;
-moz-box-shadow: 0 3px 5px 0 #999;
box-shadow: 0 3px 5px 0 #999;
border: 1px solid #CCC;
background: #3A4FC5;
color: #656161;
opacity: .8;
min-width: 30px;
top: 60px;
}
nav .main-nav .dropdown-content a {
color: black;
text-decoration: none;
display: block;
text-align: center;
}
nav .main-nav .dropdown-content a:hover {
background-color: #3A4FC5
}
nav .main-nav .dropdown:hover .dropdown-content {
display: inline-block;
}
nav .main-nav ul.left {
float: left;
margin-left: 5px;
}
.dropdown-content ul {
padding: 0;
width: auto !important;
display: flex;
flex-direction: column;
}
.dropdown-content ul li {
height: auto !important;
position: relative;
}
.dropdown-content ul li:hover > .dropdown-content-second {
display: block;
}
.dropdown-content-second {
position: absolute;
display: none;
float: left;
z-index: 10;
-webkit-box-shadow: 0 3px 5px 0 #999;
-moz-box-shadow: 0 3px 5px 0 #999;
box-shadow: 0 3px 5px 0 #999;
border: 1px solid #CCC;
background: #3A4FC5;
color: #656161;
opacity: .8;
min-width: 30px;
top: 0;
left: 100%;
}
.dropdown-content-second ul li {
position: relative;
}
nav .main-nav ul.right {
float: right;
margin-left: 5px
}
<nav>
<div class="main-nav">
<ul class="left">
<li class="dropdown">Home
<div class="dropdown-content">
<ul>
<li>
Third
<div class="dropdown-content-second">
<ul>
<li>
Navi 1
</li>
<li>
Navi 2
</li>
<li>
Navi 3
<div class="dropdown-content-second">
<ul>
<li>
Navi 1
</li>
<li>
Navi 2
</li>
<li>
Navi 3
</li>
<li>
Navi 4
</li>
<li>
Navi 5
</li>
</ul>
</div>
</li>
</ul>
</div>
</li>
<li>
Third Link
</li>
<li>
Third Link 3
</li>
</ul>
</div>
</li>
<li>Gods</li>
<li>Goddesses</li>
</ul>
<div class="play-now"></div>
<ul class="right">
<li>Heroes</li>
<li>Myths</li>
<li>Beasts</li>
</ul>
</div>
</nav>
Take a look on my menu
#import url(https://fonts.googleapis.com/css?family=Oxygen+Mono);
/* Starter CSS for Menu */
#cssmenu {
padding: 0;
margin: 0;
border: 0;
width: auto;
}
#cssmenu ul,
#cssmenu li {
list-style: none;
margin: 0;
padding: 0;
}
#cssmenu ul {
position: relative;
z-index: 597;
}
#cssmenu ul li {
float: left;
min-height: 1px;
vertical-align: middle;
}
#cssmenu ul li.hover,
#cssmenu ul li:hover {
position: relative;
z-index: 599;
cursor: default;
}
#cssmenu ul ul {
visibility: hidden;
position: absolute;
top: 100%;
left: 0;
z-index: 598;
width: 100%;
}
#cssmenu ul ul li {
float: none;
}
#cssmenu ul ul ul {
top: 0;
left: 190px;
width: 190px;
}
#cssmenu ul li:hover > ul {
visibility: visible;
}
#cssmenu ul ul {
bottom: 0;
left: 0;
}
#cssmenu ul ul {
margin-top: 0;
}
#cssmenu ul ul li {
font-weight: normal;
}
#cssmenu a {
display: block;
line-height: 1em;
text-decoration: none;
}
/* Custom CSS Styles */
#cssmenu {
background: #333;
border-bottom: 4px solid #9c9797;
font-family: 'Oxygen Mono', Tahoma, Arial, sans-serif;
font-size: 12px;
}
#cssmenu > ul {
*display: inline-block;
}
#cssmenu:after,
#cssmenu ul:after {
content: '';
display: block;
clear: both;
}
#cssmenu ul {
text-transform: uppercase;
}
#cssmenu ul ul {
border-top: 4px solid #9c9797;
text-transform: none;
min-width: 190px;
}
#cssmenu ul ul a {
background: #9c9797;
color: #ffffff;
border: 1px solid #837d7d;
border-top: 0 none;
line-height: 150%;
padding: 16px 20px;
font-size: 12px;
}
#cssmenu ul ul ul {
border-top: 0 none;
}
#cssmenu ul ul li {
position: relative;
}
#cssmenu ul ul li:first-child > a {
border-top: 1px solid #837d7d;
}
#cssmenu ul ul li:hover > a {
background: #b5b1b1;
color: #ffffff;
}
#cssmenu ul ul li:last-child > a {
-moz-border-radius: 0 0 3px 3px;
-webkit-border-radius: 0 0 3px 3px;
border-radius: 0 0 3px 3px;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
-moz-box-shadow: 0 1px 0 #9c9797;
-webkit-box-shadow: 0 1px 0 #9c9797;
box-shadow: 0 1px 0 #9c9797;
}
#cssmenu ul ul li:last-child:hover > a {
-moz-border-radius: 0 0 0 3px;
-webkit-border-radius: 0 0 0 3px;
border-radius: 0 0 0 3px;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
}
#cssmenu ul ul li.has-sub > a:after {
content: '+';
position: absolute;
top: 50%;
right: 15px;
margin-top: -8px;
}
#cssmenu ul li:hover > a,
#cssmenu ul li.active > a {
background: #9c9797;
color: #ffffff;
}
#cssmenu ul li.has-sub > a:after {
content: '+';
margin-left: 5px;
}
#cssmenu ul li.last ul {
left: auto;
right: 0;
}
#cssmenu ul li.last ul ul {
left: auto;
right: 99.5%;
}
#cssmenu a {
background: #333;
color: #CBCBCB;
padding: 0 20px;
}
#cssmenu > ul > li > a {
line-height: 48px;
font-size: 12px;
}
#cssmenu.align-center > ul {
text-align: center;
font-size: 0;
}
#cssmenu.align-center > ul > li {
display: inline-block;
float: none;
}
#cssmenu.align-center ul ul {
text-align: left;
}
#cssmenu.align-right > ul > li {
float: right;
}
#cssmenu.align-right ul ul {
left: auto;
right: 0;
text-align: right;
}
#cssmenu.align-right ul ul ul {
left: auto;
right: 190px;
}
#cssmenu.align-right ul ul li.has-sub > a:after {
left: 15px;
right: auto;
}
<html lang="ru" dir="ltr">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Icon Library -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
</head>
<body>
<div id="cssmenu">
<ul>
<li class="active"><i class="fa fa-fw fa-home"></i> Home</li>
<li class="has-sub"><i class="fa fa-fw fa-bars"></i> Menus
<ul>
<li class="has-sub">Menu 1
<ul>
<li>Menu 1.1</li>
<li>Menu 1.2</li>
<li>Menu 1.3</li>
<li class="has-sub">Menu 1.4
<ul>
<li>Menu 1.4.1</li>
<li>Menu 1.4.2</li>
<li>Menu 1.4.3</li>
<li>Menu 1.4.4</li>
</ul>
</li>
</ul>
</li>
<li class="has-sub">Menu 2
<ul>
<li>Menu 2.1</li>
<li>Menu 2.2</li>
<li>Menu 2.3</li>
</ul>
</li>
<li class="has-sub">Menu 3
<ul>
<li>Menu 3.1</li>
<li>Menu 3.2</li>
<li class="has-sub">Menu 3.3
<ul>
<li>Menu 3.3.1</li>
<li>Menu 3.3.2</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li><i class="fa fa-fw fa-cog"></i> About us</li>
<li><i class="fa fa-fw fa-phone"></i> Contact</li>
</ul>
</div>
</body>
</html>

Bootstrap Navigation Bar Not Working

This is only my second question here on Stack overflow so if there is any additional information you need or clarification needed on anything I say, please don't hesitate to ask.
I tried looking into this question and did find some people here with a similar issue, but none of the fixes that helped with them worked for me.
I am looking to have my navigation bar hidden when the max width doesn't exceed more than 767px. When it goes below that pixel amount, it should become a drop down menu that should collapse and expand when clicked by the button. This does not seem to be working for me.
My code is as follows
HTML
<header class="pull-center" id="masthead">
<nav class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<div id="img1"></div>
<div id="img2"></div>
<div id="img3"></div>
<div id="img4"></div>
<a class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<a class="brand brand-ctg" href="#section-1"><span></span></a>
CTG
<span></span>
</a>
<div class="nav-collapse">
<ul class="nav">
<li>Demo Reel</li>
<li>Portfolio</li>
<li><a class="brand brand-ctg" href="#section-1"> <span></span></a></li>
<li>Contact</li>
<li>Blog</li>
</ul>
</div>
</div>
</div>
</nav>
</header>
CSS
#media (max-width: 767px) {
.nav-collapse .nav > li {
float: left !important;
}
.navbar .in .nav li {
display: block;
float: none;
width:100%;
}
.navbar .nav > li > a {
color: #fff !important;
float: none;
margin-right: -3px !important;
padding: 0 40px 10px !important;
text-decoration: none;
}
.navbar .nav {
margin-top: 0 !important;
position: fixed!important;
z-index: 1;
}
.nav-collapse .brand {
display: block !important;
}
.navbar .nav .active a,
.navbar .nav > li > a:hover,
.navbar .nav > .active > a:hover,
.navbar .nav > .active > a:focus {
background-color: transparent;
box-shadow: none;
color: #2d2e2d !important;
}
.navbar-fixed-top,
.navbar-fixed-bottom,
.navbar-static-top {
margin-left: -20px;
margin-right: -20px;
}
.navbar-fixed-top,
.navbar-fixed-bottom {
position: static;
}
.navbar-fixed-top {
margin-bottom: 30px;
}
.navbar-fixed-bottom {
margin-top: 30px;
}
.navbar-fixed-top .navbar-inner,
.navbar-fixed-bottom .navbar-inner {
padding: 5px;
}
.navbar .container {
width: auto;
padding: 0;
}
.navbar .brand {
margin: -10px 40px 0 0;
}
.nav-collapse {
clear: both;
}
.nav-collapse .nav {
float: none;
margin: 0 0 15px;
}
.nav-collapse .nav > li {
float: none;
}
.nav-collapse .nav > li > a {
margin-bottom: 2px;
}
.nav-collapse .nav > .divider-vertical {
display: none;
}
.nav-collapse .nav .nav-header {
color: #555555;
text-shadow: none;
}
.nav-collapse .nav > li > a,
.nav-collapse .dropdown-menu a {
padding: 9px 15px;
font-weight: bold;
color: #555555;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
.nav-collapse .btn {
padding: 4px 10px 4px;
font-weight: normal;
-webkit-border-radius: 0px;
-moz-border-radius: 0px;
border-radius: 0px;
}
.nav-collapse .dropdown-menu li + li a {
margin-bottom: 2px;
}
.nav-collapse .nav > li > a:hover,
.nav-collapse .dropdown-menu a:hover {
background-color: #f2f2f2;
}
.navbar-inverse .nav-collapse .nav > li > a,
.navbar-inverse .nav-collapse .dropdown-menu a {
color: #999999;
}
.navbar-inverse .nav-collapse .nav > li > a:hover,
.navbar-inverse .nav-collapse .dropdown-menu a:hover {
background-color: #111111;
}
.nav-collapse.in .btn-group {
margin-top: 5px;
padding: 0;
}
.nav-collapse .dropdown-menu {
position: static;
top: auto;
left: auto;
float: none;
display: none;
max-width: none;
margin: 0 15px;
padding: 0;
background-color: transparent;
border: none;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
.nav-collapse .open > .dropdown-menu {
display: block;
}
.nav-collapse .dropdown-menu:before,
.nav-collapse .dropdown-menu:after {
display: none;
}
.nav-collapse .dropdown-menu .divider {
display: none;
}
.nav-collapse .nav > li > .dropdown-menu:before, .nav-collapse .nav > li > .dropdown-menu:after {
display: none;
}
.nav-collapse .navbar-form,
.nav-collapse .navbar-search {
float: none;
padding: 15px 15px;
margin: 15px 0;
border-top: 1px solid #f2f2f2;
border-bottom: 1px solid #f2f2f2;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
}
.navbar-inverse .nav-collapse .navbar-form,
.navbar-inverse .nav-collapse .navbar-search {
border-top-color: #111111;
border-bottom-color: #111111;
}
.navbar .nav-collapse .nav.pull-right {
float: none;
margin-left: 0;
}
.nav-collapse,
.nav-collapse.collapse {
overflow: hidden;
height: 0;
background: #3b3b3b;
}
.navbar .btn-navbar {
background:url(http://www.colorthegrayscale.com/images/icons/hover-teal.png);
display: block;
width: 25px;
height: 50px;
position: fixed;
}
.navbar-static .navbar-inner {
padding-left: 10px;
padding-right: 10px;
}
.navbar .brand.brand-ctg span {
display: none !important;
}
EDIT 1
Tried to fix it, but still having my issue. I know some CSS is making the toggle button not work, I just can't seem to figure out what. For the sake of simply showing all my work in one place, you can find the test site here
You are overriding the bootstrap CSS styles when it is not need, so here is an example of a simple navbar based on twitter bootstrap:
Bootply DEMO
Snippet
<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.6/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<!-- Fixed navbar -->
<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>
<a class="navbar-brand" href="#">Project name</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active">Home
</li>
<li>About
</li>
<li>Contact
</li>
<li class="dropdown">
Dropdown <b class="caret"></b>
<ul class="dropdown-menu">
<li>Action
</li>
<li>Another action
</li>
<li>Something else here
</li>
<li class="divider"></li>
<li class="dropdown-header">Nav header</li>
<li>Separated link
</li>
<li>One more separated link
</li>
</ul>
</li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
</div>
See Twitter Bootstrap Navbar Docs
EDIT: Based on your comment/updated question
here is your issue:
<a class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse">
<!-- <span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span> -->
<a class="brand brand-ctg" href="#section-1"><span>CTG</span></a>
</a>
you are opening an a inside another a and that's invalid HTML. Here's how to fix it (according to Docs):
<button type="button" class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="brand brand-ctg" href="#section-1"><span>CTG</span></a>
EDIT2:
I was looking and you are using an old version of bootstrap.css (v.2.2.1), the latest stable is 3.3.6, and you are missing the bootstrap.js (which make the menu to trigger when it is collapsed)

Bootstrap navbar with off canvas menu

On my dashboard example I have the bootstrap navbar menu on top of the column_left menu as shown in code preview below
Update: This link has now be updated with new code from my Answer!
Code Preview Click Here
What I am trying to be able to do is have the navbar so its on the edge of the column left side bar and and open and close correct width also.
Currently the menu opens and closes under neath the navbar.
Question: How can I make my navbar so it on the edge of the sidebar
rather than on top and open and close with same width. I have tried to
put the navbar in side the content div but no luck.
HTML
<div id="column-left">
<ul id="menu">
<li>
<i class="fa fa-dashboard fa-fw"></i> <span>Dashboard</span>
</li>
<li>
<i class="fa fa-bar-chart"></i> <span>Single Link</span>
</li>
<li>
<a class="parent"><i class="fa fa-cog fa-fw"></i> <span>Multilevel Menu</span></a>
<ul>
<li>Link 1</li>
<li><a class="parent">Sub Multilevel Menu 1</a>
<ul>
<li>Sub Menu Link 1a</li>
<li>Sub Menu Link 1b</li>
</ul>
</li>
<li><a class="parent">Sub Multilevel Menu 2</a>
<ul>
<li>Sub Menu Link 2a</li>
<li>Sub Menu Link 2b</li>
<li>Sub Menu Link 2c</li>
</ul>
</li>
</ul>
</li><!-- System -->
</ul>
</div>
<div id="content">
<div class="main">
<div class="container-fluid">
<!-- Fixed navbar -->
<nav class="navbar navbar-default navbar-fixed-top navbar-shadow">
<div class="navbar-header">
<button aria-controls="navbar" aria-expanded="false" data-target="#navbar" data-toggle="collapse" class="navbar-toggle collapsed" type="button">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a type="button" id="button-menu" class="navbar-brand"><i class="fa fa-indent fa-lg"></i></a>
Project name
</div>
<div class="navbar-collapse collapse" id="navbar">
<ul class="nav navbar-nav">
<li class="active">Home</li>
<li>About</li>
<li>Contact</li>
<li class="dropdown">
<a aria-expanded="false" aria-haspopup="true" role="button" data-toggle="dropdown" class="dropdown-toggle" href="#">Dropdown <span class="caret"></span></a>
<ul class="dropdown-menu">
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li class="divider" role="separator"></li>
<li class="dropdown-header">Nav header</li>
<li>Separated link</li>
<li>One more separated link</li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>Default</li>
<li>Static top</li>
<li class="active">Fixed top <span class="sr-only">(current)</span></li>
</ul>
</div><!--/.nav-collapse -->
</nav>
</div>
</div>
</div>
CSS
#import url(//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800&subset=latin,cyrillic-ext,greek-ext,vietnamese);
/* Global */
body {
/*height: 100%;*/
margin: 0;
/*min-height: 100% !important;*/
font-family: 'Open Sans', sans-serif;
overflow-x: hidden;
padding-top: 70px;
width: 100%;
background-color: #eee;
}
a,
a:hover,
a:focus {
cursor: pointer;
text-decoration: none;
}
tr:hover a.dashboard-user:after {
font-family: FontAwesome;
content: "\f044";
font-size: 14px;
}
/* fix for bootstrap hidden and visible */
span.hidden-xs, span.hidden-sm, span.hidden-md, span.hidden-lg {
display: inline;
}
/* Layout */
.container-fluid {
padding-left: 20px;
padding-right: 20px;
}
#content {
padding-bottom: 40px;
transition: all 0.3s;
}
/* Column Left */
#column-left {
width: 50px;
min-height: 100%;
background-color: #242424;
top: 0px;
position: fixed;
padding-top: 70px;
z-index: 10;
transition: all 0.3s;
}
#column-left:hover{
width: 250px;
}
#column-left + #content {
margin-left: 50px;
}
#column-left + #content + #footer {
margin-left: 50px;
}
#media (max-width: 767px) {
#column-left {
overflow: hidden;
display: none;
}
#column-left + #content {
margin-left: 0;
}
#column-left + #content + #footer {
margin-left: 0;
}
}
/* Column Left Active */
#column-left.active {
width: 235px;
display: block;
}
#media (min-width: 768px) {
#column-left.active {
overflow: auto;
}
#column-left.active + #content {
margin-left: 235px;
}
#column-left.active + #content + #footer {
margin-left: 235px;
}
}
#media (max-width: 767px) {
#column-left.active + #content {
position: relative;
left: 235px;
}
#column-left.active + #content + #footer {
position: relative;
left: 235px;
}
}
#column-left.active {
width: 235px;
}
#column-left.active #menu li i {
font-size: 14px;
}
#column-left.active #menu > li > a > span {
display: inline;
}
#column-left.active #menu > li > ul {
position: relative;
left: auto;
top: auto;
width: auto;
visibility: visible;
}
/* Top Navbar */
.menu {
background: #eeeeee none repeat scroll 0 0;
}
.navbar {
background-color: #fff !important;
border: 0 none;
border-radius: 0;
color: #666;
margin-bottom: 0;
}
.navbar.navbar-shadow {
box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.08), 0 2px 0 0 rgba(0, 0, 0, 0.02);
}
#button-menu {
display: inline-block;
cursor: pointer;
color: #6D6D6D;
}
#media (max-width: 640px) {
.navbar-brand {
font-size: 14px;
padding: 15px 7px;
}
}
.profile {
display: none;
}
#column-left.active .profile {
display: block;
padding-left: 15px;
border-bottom: 1px solid #2d2d2d;
padding-bottom: 25px;
}
.profile .media-left img {
border: 2px solid #888;
border-radius: 50%;
max-width: 40px;
}
/* Sidebar Menu */
#menu,
#menu ul,
#menu li {
padding: 0;
margin: 0;
min-height: 100%;
list-style: none;
}
#menu {
margin-bottom: 25px;
}
#menu > li {
position: relative;
}
#menu li a {
text-decoration: none;
display: block;
padding: 10px;
cursor: pointer;
color: #aaaaaa;
border-bottom: 1px solid #2d2d2d;
}
#menu li a i {
color: rgba(170, 170, 170, 0.7);
font-size: 16px;
}
#menu > li > a {
color: #aaaaaa;
font-size: 14px;
padding-left: 13px;
}
#menu > li > a:hover {
background-color: #444444;
}
#menu > li > a > span {
display: none;
margin-left: 8px;
}
#menu li li a {
border-bottom: none !important;
}
#menu li li a:hover {
color: #aaaaaa;
background-color: #1e1e1e;
}
/*
#menu li li a:before {
content: "\f101";
font-size: 14px;
font-family: FontAwesome;
margin-left: 10px;
margin-right: 10px;
transition: margin ease 0.5s;
}
*/
#menu li li a:hover:before {
margin-right: 20px;
}
#menu > li.active > a {
color: #aaaaaa;
background: #242424;
}
#menu li.active li a {
color: #aaaaaa;
}
#menu li li.active > a:last-child {
color: #aaaaaa;
}
#menu li li.active a:last-child:before {
margin-left: 20px;
margin-right: 10px;
}
#menu > li > ul {
position: absolute;
left: 50px;
top: 0px;
width: 210px;
background-color: #313131;
visibility: hidden;
}
#menu li ul {
overflow: hidden;
}
#menu li li a.parent:after, #column-left.active #menu > li a.parent:after {
font-family: FontAwesome;
content: "\f105";
float: right;
margin-right: 8px;
}
#menu li li.open > a.parent:after, #column-left.active #menu > li.open > a.parent:after {
font-family: FontAwesome;
content: "\f107";
float: right;
margin-right: 8px;
}
#menu li ul a {
padding-left: 20px;
}
#menu li li ul a {
padding-left: 40px;
}
#menu li li li ul a {
padding-left: 60px;
}
#menu li li li li ul a {
padding-left: 60px;
}
#menu li li li a.parent:after, #column-left.active #menu > li a.parent:after {
font-family: FontAwesome;
content: "\f105";
float: right;
margin-right: 8px;
}
#menu li li li.open > a.parent:after, #column-left.active #menu > li.open > a.parent:after {
font-family: FontAwesome;
content: "\f107";
float: right;
margin-right: 8px;
}
#menu li ul li a.parent:after, #column-left.active #menu > li ul li a.parent:after {
font-family: FontAwesome;
content: "\f105";
float: right;
margin-right: 8px;
}
#menu li ul li.open > a.parent:after, #column-left.active #menu > li ul li.open > a.parent:after {
font-family: FontAwesome;
content: "\f107";
float: right;
margin-right: 8px;
}
Problem solved.
Updated codepen preview
Click Here For Preview
The issue was have the navbar fixed so was on top all the time.
I have removed navbar-fixed-topand removed the padding-top 70px from body {}
Image
CSS
#import url(//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800&subset=latin,cyrillic-ext,greek-ext,vietnamese);
body {
margin: 0;
font-family: 'Open Sans', sans-serif;
overflow-x: hidden;
width: 100%;
background-color: #eee;
}
a,
a:hover,
a:focus {
cursor: pointer;
text-decoration: none;
}
tr:hover a.dashboard-user:after {
font-family: FontAwesome;
content: "\f044";
font-size: 14px;
}
/* fix for bootstrap hidden and visible */
span.hidden-xs, span.hidden-sm, span.hidden-md, span.hidden-lg {
display: inline;
}
/* Layout */
.container-fluid {
padding-left: 20px;
padding-right: 20px;
}
#content {
padding-bottom: 40px;
transition: all 0.3s;
}
/* Column Left */
#column-left {
width: 50px;
min-height: 100%;
background-color: #242424;
top: 0px;
position: fixed;
padding-top: 70px;
z-index: 10;
transition: all 0.3s;
}
#column-left:hover{
width: 250px;
}
#column-left + #content {
margin-left: 50px;
}
#column-left + #content + #footer {
margin-left: 50px;
}
#media (max-width: 767px) {
#column-left {
overflow: hidden;
display: none;
}
#column-left + #content {
margin-left: 0;
}
#column-left + #content + #footer {
margin-left: 0;
}
}
/* Column Left Active */
#column-left.active {
width: 235px;
display: block;
}
#media (min-width: 768px) {
#column-left.active {
overflow: auto;
}
#column-left.active + #content {
margin-left: 235px;
}
#column-left.active + #content + #footer {
margin-left: 235px;
}
}
#media (max-width: 767px) {
#column-left.active + #content {
position: relative;
left: 235px;
}
#column-left.active + #content + #footer {
position: relative;
left: 235px;
}
}
#column-left.active {
width: 235px;
}
#column-left.active #menu li i {
font-size: 14px;
}
#column-left.active #menu > li > a > span {
display: inline;
}
#column-left.active #menu > li > ul {
position: relative;
left: auto;
top: auto;
width: auto;
visibility: visible;
}
/* Top Navbar */
.menu {
background: #eeeeee none repeat scroll 0 0;
}
.navbar {
background-color: #fff !important;
border: 0 none;
border-radius: 0;
color: #666;
margin-bottom: 0;
}
.navbar.navbar-shadow {
box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.08), 0 2px 0 0 rgba(0, 0, 0, 0.02);
}
#button-menu {
display: inline-block;
cursor: pointer;
color: #6D6D6D;
}
#media (max-width: 640px) {
.navbar-brand {
font-size: 14px;
padding: 15px 7px;
}
}
.profile {
display: none;
}
#column-left.active .profile {
display: block;
padding-left: 15px;
border-bottom: 1px solid #2d2d2d;
padding-bottom: 25px;
}
.profile .media-left img {
border: 2px solid #888;
border-radius: 50%;
max-width: 40px;
}
/* Sidebar Menu */
#menu,
#menu ul,
#menu li {
padding: 0;
margin: 0;
min-height: 100%;
list-style: none;
}
#menu {
margin-bottom: 25px;
}
#menu > li {
position: relative;
}
#menu li a {
text-decoration: none;
display: block;
padding: 10px;
cursor: pointer;
color: #aaaaaa;
border-bottom: 1px solid #2d2d2d;
}
#menu li a i {
color: rgba(170, 170, 170, 0.7);
font-size: 16px;
}
#menu > li > a {
color: #aaaaaa;
font-size: 14px;
padding-left: 13px;
}
#menu > li > a:hover {
background-color: #444444;
}
#menu > li > a > span {
display: none;
margin-left: 8px;
}
#menu li li a {
border-bottom: none !important;
}
#menu li li a:hover {
color: #aaaaaa;
background-color: #1e1e1e;
}
/*
#menu li li a:before {
content: "\f101";
font-size: 14px;
font-family: FontAwesome;
margin-left: 10px;
margin-right: 10px;
transition: margin ease 0.5s;
}
*/
#menu li li a:hover:before {
margin-right: 20px;
}
#menu > li.active > a {
color: #aaaaaa;
background: #242424;
}
#menu li.active li a {
color: #aaaaaa;
}
#menu li li.active > a:last-child {
color: #aaaaaa;
}
#menu li li.active a:last-child:before {
margin-left: 20px;
margin-right: 10px;
}
#menu > li > ul {
position: absolute;
left: 50px;
top: 0px;
width: 210px;
background-color: #313131;
visibility: hidden;
}
#menu li ul {
overflow: hidden;
}
#menu li li a.parent:after, #column-left.active #menu > li a.parent:after {
font-family: FontAwesome;
content: "\f105";
float: right;
margin-right: 8px;
}
#menu li li.open > a.parent:after, #column-left.active #menu > li.open > a.parent:after {
font-family: FontAwesome;
content: "\f107";
float: right;
margin-right: 8px;
}
#menu li ul a {
padding-left: 20px;
}
#menu li li ul a {
padding-left: 40px;
}
#menu li li li ul a {
padding-left: 60px;
}
#menu li li li li ul a {
padding-left: 60px;
}
#menu li li li a.parent:after, #column-left.active #menu > li a.parent:after {
font-family: FontAwesome;
content: "\f105";
float: right;
margin-right: 8px;
}
#menu li li li.open > a.parent:after, #column-left.active #menu > li.open > a.parent:after {
font-family: FontAwesome;
content: "\f107";
float: right;
margin-right: 8px;
}
#menu li ul li a.parent:after, #column-left.active #menu > li ul li a.parent:after {
font-family: FontAwesome;
content: "\f105";
float: right;
margin-right: 8px;
}
#menu li ul li.open > a.parent:after, #column-left.active #menu > li ul li.open > a.parent:after {
font-family: FontAwesome;
content: "\f107";
float: right;
margin-right: 8px;
}
HTML
<div id="column-left">
<ul id="menu">
<li>
<i class="fa fa-dashboard fa-fw"></i> <span>Dashboard</span>
</li>
<li>
<i class="fa fa-bar-chart"></i> <span>Single Link</span>
</li>
<li>
<a class="parent"><i class="fa fa-cog fa-fw"></i> <span>Multilevel Menu</span></a>
<ul>
<li>Link 1</li>
<li><a class="parent">Sub Multilevel Menu 1</a>
<ul>
<li>Sub Menu Link 1a</li>
<li>Sub Menu Link 1b</li>
</ul>
</li>
<li><a class="parent">Sub Multilevel Menu 2</a>
<ul>
<li>Sub Menu Link 2a</li>
<li>Sub Menu Link 2b</li>
<li>Sub Menu Link 2c</li>
</ul>
</li>
</ul>
</li><!-- System -->
</ul>
</div>
<div id="content">
<!-- Fixed navbar -->
<nav class="navbar navbar-default navbar-shadow">
<div class="container-fluid">
<div class="navbar-header">
<button aria-controls="navbar" aria-expanded="false" data-target="#navbar" data-toggle="collapse" class="navbar-toggle collapsed" type="button">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a type="button" id="button-menu" class="navbar-brand"><i class="fa fa-indent fa-lg"></i></a>
Project name
</div>
<div class="navbar-collapse collapse" id="navbar">
<ul class="nav navbar-nav">
<li class="active">Home</li>
<li>About</li>
<li>Contact</li>
<li class="dropdown">
<a aria-expanded="false" aria-haspopup="true" role="button" data-toggle="dropdown" class="dropdown-toggle" href="#">Dropdown <span class="caret"></span></a>
<ul class="dropdown-menu">
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li class="divider" role="separator"></li>
<li class="dropdown-header">Nav header</li>
<li>Separated link</li>
<li>One more separated link</li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>Default</li>
<li>Static top</li>
<li class="active">Fixed top <span class="sr-only">(current)</span></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
<div class="container-fluid">
</div>
</div>
</div>

show third level of ul li on hover of second level of ul li

I have a problem with the drop down menu style..
when I mouse hover the third level, the second level font color is changed to its color..
I want to make it keep white (as hover) when third level is hover..
How can I make it?
My style:
<!DOCTYPE html>
<html>
<head>
<style>
ul#menu
{
font-size: 20px;
display: inline;
min-height: 45px;
overflow: auto;
}
ul#menu li
{
float: left;
list-style: none;
padding-left: 20px;
background-color: #ff6a00;
border-bottom: 2px solid #181818;
border-top: 2px solid #303030;
min-width: 160px;
display: block;
position: relative;
min-height: 45px;
}
ul#menu li:hover
{
background-color: #808080;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#1c1c1c', endColorstr='#1b1b1b');
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#1c1c1c', endColorstr='#1b1b1b')";
border-bottom: 2px solid #222222;
border-top: 2px solid #1B1B1B;
}
ul#menu li a
{
text-decoration: none;
padding: 0px;
border-left: 3px solid rgba(0, 0, 0, 0);
color: white;
display: block;
font-family: 'Lucida Console';
font-size: 18px;
line-height: 45px;
padding: 0 10px;
text-decoration: none;
text-transform: uppercase;
text-align: left;
}
ul#menu li a:hover
{
border-radius: 5px 0 0 0;
border-left: 3px solid #C4302B;
color: #C4302B;
}
ul#menu li:hover
{
background-color: #DA251D;
}
ul#menu li ul
{
display: none;
}
ul#menu li:hover ul
{
display: block;
}
ul#menu li ul li
{
float: none;
}
#menu .submenu li:hover a
{
border-left: 3px solid #454545;
border-radius: 0;
color: #ffffff;
}
#menu > li:hover .submenu, .menu > li:focus .submenu
{
max-height: 2000px;
z-index: 10;
}
#menu > li:hover .submenu li, .menu > li:focus .submenu li
{
opacity: 1;
-webkit-transform: none;
-moz-transform: none;
-ms-transform: none;
-o-transform: none;
transform: none;
}
</style>
<title>Page Title</title>
</head>
<body>
<div class="ThirdMenu">
<ul id="menu" class="menu">
<li>sangeet
<ul class="submenu" id="submenu"
<li>sdfsadf
<ul class="thirdmenu" id="thirdmenu"><li>sdfsd</li></ul>
</li>
<li></li>
<li></li>
<li></li>
</ul>
</li>
</ul>
</div>
</div>
</body>
</html>
Tell me simple way to display third menu hover on main category?
if i got you right:
HTML:
<div class="menu_wrap">
<ul class="newlevel level0">
<li>level0, link 1</li>
<li>
level0, link 2
<ul class="newlevel level1">
<li>level1, link 1</li>
<li>level1, link 2</li>
<li>
level1, link 3
<ul class="newlevel level2">
<li>level2, link 1</li>
<li>level2, link 2</li>
<li>level2, link 3</li>
</ul>
</li>
</ul>
</li>
<li>level0, link 3</li>
</ul>
</div>
CSS:
.menu_wrap
{
width: 300px;
}
ul
{
padding: 0;
}
li
{
list-style: none;
}
a
{
display: block;
padding: 10px;
text-decoration: none;
background: #ff6a00;
color: #000;
border-top: 1px solid;
}
a:hover, .current > a
{
background: #DA251D;
}
.level1 a
{
padding-left: 40px;
}
.level2 a
{
padding-left: 80px;
}
.level0 ul
{
display: none;
}
.newlevel li:hover > ul
{
display: block;
}
JQuery:
$(document).ready(function(){
$('.newlevel li').hover(function(){
if ($(this).children('ul').length > 0){
$(this).addClass('current');
}
},function(){
$(this).removeClass('current');
});
});
jsfiddle: http://jsfiddle.net/esf90kz5/3/

Active last hover

I have simply HTML + CSS menu.
https://dl.dropboxusercontent.com/u/73908828/ccs_help/home.html
<head>
<style>
*, body {
padding:0px;
margin: 0px;
font-family: "Arial";
}
#line {
position: absolute;
height:62px;
width: 100%;
top: 408px;
z-index:1;
border-top: 1px solid #636363;
border-bottom: 2px solid #393939;
background-color: #0a0c0c;
-webkit-box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 1);
-moz-box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 1);
box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 1);
}
#menu-box, #menu {
width: 990px;
display: block;
margin-left: auto;
margin-right: auto;
}
#menu {
height:62px;
}
#menu ul.c {
list-style-type: none;
}
#center ul a.c {
font-size: 34px;
font-weight: bold;
line-height: 65px;
letter-spacing: 0px;
display: block;
padding-left: 30px;
padding-right: 30px;
background-repeat: no-repeat;
background-position: right;
text-decoration: none;
color: #505050;
}
#center ul a.c:hover {
color: #038aff;
}
ul#nav {
margin: 0;
padding: 0;
list-style: none;
}
ul#nav li {
display: inline;
}
ul#nav li a {
float: left;
line-height: 40px;
text-decoration: none;
}
ul#nav .current a, ul#nav li:hover > a {
text-decoration: none;
}
ul#nav ul {
display: none;
}
ul#nav li:hover > ul {
position: absolute;
display: block;
margin: 65px 0 0 0;
font-size: 14px;
letter-spacing: 1px;
color: #a4a4a4;
float:left;
left:50%;
text-align:center;
}
ul#nav li:hover > ul li {
position:relative;
right:50%;
display: table;
}
ul#nav li:hover > ul li a {
float: left;
text-decoration: none;
}
ul#nav li:hover > ul li a:hover {
text-decoration: none;
text-shadow: none;
}
.submenu {
background-color: #000;
display:table-cell;
vertical-align: middle;
border-bottom: 1px solid #393939;
white-space: nowrap;
}
</style>
</head>
<body>
<div id="line">
<div id="menu-box">
<div id="center">
<ul id="nav" class="c">
<li><a id="products" href="javascript:;" class="c" style="padding-left:0px;">PRODUCTS</a>
<ul>
<li class="outer">
<div class="submenu-left"></div>
<div class="submenu">SECOND_PRODUCTS</div>
<div class="submenu-right"></div>
</li>
</ul>
</li>
<li>MAIN_SUPPORT
<ul>
<li class="outer">
<div class="submenu-left"></div>
<div class="submenu">SECOND_SUPPORT</div>
<div class="submenu-right"></div>
</li>
</ul>
</li>
<li><a id="sale" href="javascript:;" class="c" style="background-image: none; padding-right: 0px;">DISTRIBUTION</a>
<ul>
<li class="outer">
<div class="submenu-left"></div>
<div class="submenu">SECOND_DISTRIBUTION</div>
<div class="submenu-right"></div>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<div id="main">
<div class="lgflags"></div>
<div class="img"></div>
</div>
</body>
My question is, how I make it so that second menu will always be displayed even if there will be no mouse hover? I need last hover menu always visible.
I use only HTML and CSS but if necessary, can be used JavaScript or jQuery.
Apply the hover styling to your second menu using
nth-child(2)
For example,
ul#nav li:hover > ul, ul#nav li:nth-child(2)> ul {
position: absolute;
display: block;
margin: 65px 0 0 0;
font-size: 14px;
letter-spacing: 1px;
color: #a4a4a4;
float:left;
left:50%;
text-align:center;
}