Navigation Menu Shrinks with Browser Sizing - CSS Issue - html

I created a navigation menu for a re-design of a website that's a Printing Company. Everything is working perfectly, but I can't find out why the Navigation shrinks when you change the browser size. I've created these menus before, and I've never had a problem with shrinking.
Here is the Demo https://jsfiddle.net/dshojaei/vbcztkdy/3/embedded/result/
#nav_wrap {
text-align: center;
background-color:#343232;
border-top:1px solid black;
height:54px;
}
/* Reset */
.nav,
.nav a,
.nav ul,
.nav li,
.nav div,
.nav form,
.nav input {
margin: 0;
padding: 0;
border: none;
outline: none;
}
.nav a { text-decoration: none; }
.nav li { list-style: none; }
/* Menu Container */
.nav {
display: inline-block;
position: relative;
cursor: default;
z-index: 500;
text-align:left;
}
/* Menu List */
.nav > li {
display:block;
float: left;
}
/* Menu Links */
.nav > li > a {
position: relative;
display: block;
z-index: 510;
height: 54px;
padding: 0 20px;
line-height: 54px;
font-family: Helvetica, Arial, sans-serif;
font-weight: bold;
font-size: 13px;
color: #fcfcfc;
text-shadow: 0 0 1px rgba(0,0,0,.35);
background: #343232;
border-left:none;
border-right:none;
-webkit-transition: all .3s ease;
-moz-transition: all .3s ease;
-o-transition: all .3s ease;
-ms-transition: all .3s ease;
transition: all .3s ease;
}
.businesscards:hover > a {
background:#009ad6;
}
.flyers:hover > a{
background:#c60077;
}
.cards:hover > a {
background:#cec41e;
}
.banner:hover > a {
background:#000000;
}
.dvd:hover > a {
background:#3c3c3c;
}
.stationary:hover > a {
background:#7b7b7b;
}
.labels:hover > a {
background:#afafaf;
}
.catalogs:hover > a {
background:#d7d7d7;
}
.nav > li:first-child > a {
border-radius: 0px 0 0 0px;
border-left: none;
}
/* Menu Dropdown */
.nav > li > div {
position: absolute;
display: block;
width: 100%;
top: 55px;
left: 0;
opacity: 0;
visibility: hidden;
overflow: hidden;
border-right:1px solid black;
border-left:1px solid black;
border-bottom:1px solid black;
background: #ffffff;
border-radius: 0 0 3px 3px;
-webkit-transition: all .3s ease .15s;
-moz-transition: all .3s ease .15s;
-o-transition: all .3s ease .15s;
-ms-transition: all .3s ease .15s;
transition: all .3s ease .15s;
}
.nav > li:hover > div {
opacity: 1;
visibility: visible;
overflow: visible;
}
/* Menu Content Styles */
.nav .nav-column {
float: left;
width: 20%;
padding: 2.5%;
}
.nav .nav-column h3 {
margin: 20px 0 10px 0;
line-height: 18px;
display:inline;
font-family: Helvetica, Arial, sans-serif;
font-weight: bold;
font-size: 14px;
color: #372f2b;
text-transform: uppercase;
}
/*.nav .nav-column img {
display:inline;
width:20%;
height: 20%;
}
*/
.nav img:nth-of-type(1) {
margin-top:30px;
margin-left:20px;
float:left;
width:5%;
height:5%;
}
.nav img:nth-of-type(2) {
margin-top:30px;
margin-left:20px;
float:left;
width:5%;
height:5%;
}
#brochure {
margin-top:30px;
margin-left:20px;
float:left;
width:3%;
height:3%
}
.nav .nav-column h3.orange { color: #ff722b; }
.nav .nav-column li a {
display: block;
line-height: 26px;
font-family: Helvetica, Arial, sans-serif;
font-weight: bold;
font-size: 13px;
color: #888888;
}
.nav .nav-column li a:hover { color: #666666; }

fix the width.
.nav {
display: inline-block;
position: relative;
cursor: default;
z-index: 500;
text-align: left;
width: 1190px;
}

You can change the code for the list items to the following:
.nav > li {
display: inline-block;
}
And, add the following declaration to the list rule set:
.nav {
display: inline-block;
position: relative;
cursor: default;
z-index: 500;
text-align:left;
white-space: nowrap;
}
In order, for this to display properly, the list items, in HTML, should be next to each other, otherwise you'll see spaces:
<ul><li></li><li></li></ul>

Related

NAV menu doesn't appear on top

How do i make my nav menu permanently on top? I have two nav menu's on a page - a main hamburger nav menu that clicks and pops up, and then an embedded page nav menu
I would like the hamburger nav menu to be permanently on top, but for some reason the embedded nav menu appears through.
Here is a codepen of the issue: https://codepen.io/TheGreatEscape/pen/ebYgGO
Here is a short youtube video if the issue: https://youtu.be/sWzCLOzRJUQ
and the related CSS Code:
/*===== NAV BUTTONS ===*/
#menu-button{ display:none}
a {
-webkit-transition: .3s all ease;
-o-transition: .3s all ease;
transition: .3s all ease;
}
a:hover, a:active, a:focus {
outline: none;
float:none;
clear:both;
text-align:center;
display:inline-block;
position:absolute;
left:0;
right:0 }
.templateux-navbar {
position: fixed;
top: 0px;
left: 0;
width: 100%;
padding: 0;
z-index: 99999;
}
.templateux-navbar .container-fluid {
max-width: 100%;
}
.templateux-navbar .toggle-menu {
z-index: 9999;
}
.templateux-navbar .templateux-menu {
top:35px;
float:none;
clear:both;
text-align:center;
display:inline-block;
position:absolute;
right:210px
}
.templateux-navbar .templateux-menu ul {
position:relative;
float:right;
margin-bottom: 0;
margin-top: 18.5px;
right:178px;
}
.templateux-navbar .templateux-menu ul li {
display: block;
}
.templateux-navbar .templateux-menu ul li a {
left:30px;
top:.5px;
text-decoration: none;
border-radius:0; border:none;
line-height:40px;
display:block;
margin-right: 0px;
font-size: 13px;
text-transform: uppercase;
letter-spacing: .05em;
color: #1a1a1a;
position: relative;
padding-bottom: 5px;
}
.templateux-navbar .templateux-menu ul li a:before {
content: "";
position: absolute;
bottom: 6px;
height: 3px;
width: 0;
left: 0px;
background: #f70f4d;
-webkit-transition: .45s width ease;
-o-transition: .45s width ease;
transition: .45s width ease;
}
.templateux-navbar .templateux-menu ul li a:hover:before {
width: 100%;
}
.templateux-navbar .templateux-menu ul li a:hover {
text-decoration: none;
background-color: inherit;
border:none;
color:#1a1a1a;
font-weight:bold
}
.templateux-navbar .templateux-menu ul li h5 {
position: absolute;
text-decoration: none;
background-color: inherit;
left: 125px;
top: -8px;
color:#1a1a1a;
font-weight:bold;
font-size: 13px;
border-radius:0;
border:none;
line-height:40px;
display: inline-block;
width: 100%;
letter-spacing: .1em;
}
.templateux-navbar .templateux-menu ul li.active > a:before {
width: 100%;
}
.templateux-navbar .templateux-menu ul li:last-child a {
margin-right: 0;
}
/*===== BACKGROUND MENU FOR MENU BUTTON, GET IN TOUCH ===*/
.menu {
width: 33px;
height: 33px;
padding: 5px;
display: block;
cursor: pointer;
position: relative;
float: right;
right: -56px;
top: 24px;
z-index: 1;
}
.menu span {
cursor: pointer;
height: 3.25px;
width: 24px;
margin-bottom: 3px;
background: #000;
position: relative;
right: 0;
display: block;
transform: rotate(0deg);
transition: .7s ease;
}
.hidden {
opacity: 0;
transition-delay: .5s;
pointer-events: none;
cursor: default;
}
.visible {
opacity: .97;
}
.menu.open span:nth-child(1) {
top: 10px;
transform: rotate(180deg);
transition: .7s ease;
background: #ffffff;
}
.menu.open span:nth-child(2) {
opacity: 0;
right: 100px;
background: #000;
}
.menu.open span:nth-child(3) {
top: 0px;
transform: rotate(-180deg);
transition: .8s ease;
background: #ffffff;
}
#navigation {
background: #000000;
font-family: 'Titling Gothic Bold';
color: rgb(0, 0, 0);
font-size: 0px;
width: 100%;
height: 450px;
text-align:left;
}
Your issue is the z-index. I fixed it by adding the class hamburger to your first .templateux-navbar element and then modified your CSS a bit. You can see the modified CSS below.
.templateux-navbar {
position: fixed;
top: 0px;
left: 0;
width: 100%;
padding: 0;
z-index: 9;
}
.templateux-navbar.hamburger {
z-index: 10;
}
Your code has this issue because you gave both the menus the same z-index so it means that the element that is defined next in the HTML will naturally get higher priority, which in your case is your second nav.
Making your hamburger menu have a higher z-index solves this issue.

How can I make this link cover a larger area without revealing the words underneath?

If you hover over the words in the navbar you can see they do a little transition. Now, for this hover effect to happen you don't need to put the cursor directly on the word, you can put the cursor anywhere under or above the word and it will still activate the transition.
Now here's the problem, to go to a different page you have to click directly on the word. I want to be able to click on the link even if my mouse is slightly above/below the word.
Here's the JSFIDDLE link
HTML
body {
background-image:url('../images/geometry2.jpg');
}
.homeBody {
display:none;
}
header {
padding:0 !important;
margin:0 !important;
font-family:"Raleway", sans-serif !important;
}
header nav a {
color:#fff !important;
font-family:"Raleway", sans-serif !important;
}
.navbar-nav > li {
color:#fff !important;
font-family:"Raleway", sans-serif !important;
}
header nav li:hover a, header nav li.active a {
color:#ecf0f1 !important;
}
header nav li:hover, header nav li.active {
color:#ecf0f1 !important;
}
.navbar-default .navbar-toggle .icon-bar {
background-color:#fff;
}
.navbar-default .navbar-toggle {
border-color:#fff;
}
.linkContain {
position:absolute;
}
#media screen and (max-width: 767px) {
.navbar-nav > li, .menu-small header .navbar-nav > li, .touch header .navbar-nav > li {
background:#0e6957;
}
}
.title {
width:100%;
margin-top:120px;
text-align:center;
font-family:'Lato', sans-serif, serif;
font-size:50px;
color:#2d2d2d;
}
.images-3 {
margin-top:30px;
}
.incenseTypes {
width:80%;
margin:40px auto 0 auto;
}
.smolder {
width:80%;
margin:40px auto 0 auto;
}
.smolder img {
width:100%;
}
.view-button {
width:100%;
height:50px;
line-height:50px;
background:#16a085;
color:#fff;
font-size:24px;
}
.view-button:hover {
background:#0e6957;
}
.aboutSection {
width:80%;
margin:auto;
}
.infoTitle {
font-family:'Lato', sans-serif, serif;
}
.infoTitle2 {
font-size:35px;
font-family:'Lato', sans-serif, serif;
}
.infoBullets {
font-size:18px;
}
.infoIntro {
font-size:18px;
}
.infoLink {
color:#3aa5d2;
}
footer {
height:100px;
background:#148d75;
color:#fff;
font-size:23px;
}
footer a {
color:#fff;
}
footer a:hover {
text-decoration:none;
color:#4cbceb;
}
.copyrightRow {
margin-top:15px;
}
ul.social-buttons {
margin-top: -10px;
margin-bottom: 0;
}
.social-buttons {
text-align:center;
}
.fa-facebook {
width:50px;
height:50px;
display:block;
background-image:url('../images/home/icons/facebook.svg');
background-repeat:no-repeat;
transition:all 0.4s;
}
.fa-facebook:hover {
background-image:url('../images/home/icons/facebookHover.svg');
}
.fa-twitter {
width:50px;
height:50px;
display:block;
background-image:url('../images/home/icons/twitter.svg');
background-repeat:no-repeat;
transition:all 0.4s;
}
.fa-twitter:hover {
background-image:url('../images/home/icons/twitterHover.svg');
}
.topScentsTitle {
width:80%;
margin:auto;
text-align:center;
font-size:35px;
color:#2d2d2d;
}
.topScents {
width:80%;
margin:20px auto 0 auto;
}
.buyNow {
width:80%;
margin:auto;
height:40px;
line-height:40px;
font-size:25px;
color:#fff;
}
.buyNow {
width:80%;
margin:auto;
height:40px;
line-height:40px;
font-size:18px;
color:#fff;
background:#148d75;
border:none;
padding:0px !important;
transition:all 0.3s;
-ms-transition:all 0.3s
}
.buyNow:hover {
background:#0e6957;
}
.moreInfo {
width:80%;
margin:5px auto 0 -4px;
height:40px;
line-height:40px;
font-size:18px;
color:#fff;
background:#34495e;
padding:0px !important;
border:none;
transition:all 0.3s;
-ms-transition:all 0.3s
}
.moreInfo:hover {
background:#2c3e50;
}
.btn {
padding:0;
}
.navbar-default .navbar-nav>li>a {
padding:0;
}
a {
-webkit-transition: color 200ms linear;
-moz-transition: color 200ms linear;
transition: color 200ms linear;
}
body {
/*background:#bg-light;*/
background: #fff;
font-family: "Raleway", sans-serif;
font-size: 13px;
color: #999999;
outline: none;
}
body.home {
background: #fff;
}
*,
a,
button,
input,
*:focus,
a:focus,
button:focus,
input:focus {
outline: none!important;
}
.centered {
float: none;
margin: 0 auto;
}
.neuton {
font-family: "Neuton", serif;
}
.neuton_bold {
font-family: "Neuton", serif;
font-weight: 700;
}
.neuton_italic {
font-family: "Neuton", serif;
font-style: italic;
}
.rale {
font-family: "Raleway", sans-serif;
}
.rale_medium {
font-family: "Raleway", sans-serif;
font-weight: 500;
}
.rale_bold {
font-family: "Raleway", sans-serif;
font-weight: 700;
}
h1,
h2,
h3,
h4 {
font-family: "Neuton", serif;
color: #9a8e87;
}
h1 {
font-size: 48px;
line-height: 45px;
}
h2 {
font-size: 25px;
line-height: 22px;
}
a {
color: #666;
}
a:hover,
a:focus {
text-decoration: underline;
color: #333333;
}
.touch .touch-hide {
display: none;
}
.no-touch .touch-show {
display: none;
}
.touch .touch-show {
display: block;
}
.btn {
font-family: "Raleway", sans-serif;
font-weight: 500;
font-size: 13px;
text-transform: uppercase;
border-radius: 0;
-webkit-border-radius: 0;
padding: 15px 45px;
-webkit-transition: all 200ms linear;
-moz-transition: all 200ms linear;
transition: all 200ms linear;
background: #e2dbd7;
color: #fff;
}
.btn:hover,
.btn:focus,
.btn:active,
.btn.active,
.open .dropdown-toggle.btn {
color: #ffffff;
background-color: #b5afac;
}
.btn-red {
color: #ffffff;
background-color: #cc3300;
}
.btn-red:hover,
.btn-red:focus,
.btn-red:active,
.btn-red.active,
.open .dropdown-toggle.btn-red {
color: #ffffff;
background-color: #a32900;
}
.btn-red:active,
.btn-red.active,
.open .dropdown-toggle.btn-red {
background-image: none;
}
.form-group {
margin-bottom: 35px;
}
.control-label {
font-size: 16px;
color: #9a8e87;
font-family: "Raleway", sans-serif;
font-weight: normal;
text-transform: uppercase;
margin-bottom: 15px;
}
.form-control {
border-radius: 0;
-webkit-border-radius: 0;
background: none;
font-family: "Raleway", sans-serif;
color: #b7b7b7;
font-size: 14px;
box-shadow: none;
-webkit-box-shadow: none;
padding: 15px 10px;
height: 48px;
border: 1px solid #cac2b5;
}
.form-control:focus {
box-shadow: none;
border-color: #7c7c7c !important;
}
.form-control.required {
border-color: #cc3300!important;
border-left-width: 7px;
}
.control-label.required {
color: #cc3300;
}
.selectizer.required .selectizer-label {
border-color: #cc3300;
}
.right {
float: right;
}
.navbar-default {
height: 102px;
border-bottom: 1px solid #e9e7e6;
}
.navbar-nav > li {
padding: 15px;
-webkit-transition: all 200ms linear;
-moz-transition: all 200ms linear;
transition: all 200ms linear;
height: 102px;
padding-top: 40px;
}
.navbar-nav > li > a {
padding: 0;
}
header {
background: #148d75 !important;
-webkit-transition: height 200ms linear;
-moz-transition: height 200ms linear;
transition: height 200ms linear;
}
header ul {
margin: 0;
padding: 0;
}
header .navbar-collapse {
float: right;
}
header nav {
float: right;
border-right: 1px solid #E9E7E6;
/* background: #bg-light;*/
}
header nav li {
/*border-left: 1px solid rgba(229,227,225,0); border-right: 1px solid rgba(229,227,225,0);*/
/*border-bottom: 1px solid #line-light;*/
cursor: pointer;
}
header nav a {
color: #dad1cd!important;
overflow: hidden;
height: 20px;
display: inline-block;
font-size: 15px;
text-transform: uppercase;
font-weight: 600;
}
header nav a span {
position: relative;
display: inline-block;
-webkit-transition: -webkit-transform 0.3s;
-moz-transition: -moz-transform 0.3s;
transition: transform 0.3s;
}
header nav li:hover,
header nav li.active {
/*background: #nav-light-hover-bg;*/
border-left-color: #e9e7e6;
border-right-color: #e9e7e6;
/*border-bottom: 1px solid #bg-light;*/
}
header nav li:hover a,
header nav li.active a {
color: #a49993!important;
}
header nav li.active {
background: #fff;
border-left: 1px solid #e9e7e6;
border-right: 1px solid #e9e7e6;
}
header nav li:not(.active) a span::before {
position: absolute;
top: 100%;
content: attr(data-hover);
-webkit-transform: translate3d(0, 0, 0);
-moz-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
width: 100%;
text-align: center;
}
header nav li:not(.active):hover a span,
header nav li:not(.active) a:focus span {
-webkit-transform: translatey(-100%);
-moz-transform: translatey(-100%);
transform: translatey(-100%);
}
header .user {
float: right;
}
header .user li {
list-style: none;
float: left;
border-right: 0;
}
header .user li a {
height: 102px;
padding: 0 15px;
display: inline-block;
padding-top: 43px;
font-weight: 600;
font-size: 15px;
text-decoration: none!important;
}
header .user li a .mask {
width: 16px;
height: 16px;
overflow: hidden;
display: inline-block;
}
header .user li a .mask span {
display: block;
width: 16px;
height: 32px;
text-indent: -9999px;
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
-webkit-transform: translate(0px, 0px);
-moz-transform: translate(0px, 0px);
transform: translate(0px, 0px);
transition-delay: .05s;
-webkit-transition-delay: .05s;
}
header .user li a .num {
color: #cc3300;
}
header .user li a:hover .mask span,
header .user li a.active .mask span {
transition-delay: 0;
-webkit-transition-delay: 0;
-webkit-transform: translate(0px, -16px);
-moz-transform: translate(0px, -16px);
transform: translate(0px, -16px);
/*margin-top: -16px*/
}
header .user li.profile {
margin-right: 2px;
}
header .user li.profile a .mask span {
background: url('../images/header-user-light.png') 0 0 no-repeat;
}
header .user li.cart a .mask span {
background: url('../images/header-cart-light.png') 0 0 no-repeat;
}
header .user li.cart a.active .mask span {
background-image: url("../images/header-cart-light-active.png");
}
header .user li.lang a {
padding-top: 20px;
padding-right: 0;
-webkit-transition: padding-top 200ms linear;
-moz-transition: padding-top 200ms linear;
transition: padding-top 200ms linear;
}
header .user li.lang span {
display: inline-block;
width: 60px;
height: 60px;
line-height: 60px;
border: 1px solid #e9e7e6;
text-align: center;
color: #e9e7e6;
-webkit-transition: all 200ms linear;
-moz-transition: all 200ms linear;
transition: all 200ms linear;
}
header .user li.lang span:hover {
color: #a49993;
text-decoration: none;
border-color: #a49993;
}
.navbar-nav > li.li-language,
.touch header .navbar-nav > li.li-language {
border-top: 1px solid #f0edeb !important;
}
.home.menu-abs header {
position: absolute;
top: 0 !important;
}
.navbar-collapse.in nav,
.navbar-collapse.collapsing nav {
float: none;
border-right: none;
padding-right: 0;
height: auto;
}
.navbar-default .navbar-nav > .disabled > a,
.navbar-default .navbar-nav > .disabled > a:hover,
.navbar-default .navbar-nav > .disabled > a:focus {
color: #bfb6b1;
}
.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
color: #a49993;
}
.navbar-nav > li:last-child {
border-right: 0;
}
.navbar-collapse .navbar-nav.navbar-right:last-child {
margin-right: 0;
}
#header-logo {
display: block;
width: 170px;
height: 102px;
float: left;
position: relative;
overflow: hidden;
background: none;
margin-top: 0px;
margin-bottom: 0px;
margin-left: 0;
padding: 0;
-webkit-transition: height 200ms linear;
-moz-transition: height 200ms linear;
transition: height 300ms linear;
}
#header-logo span {
display: block;
width: 170px;
height: 102px;
z-index:-1;
position: relative;
background: url('../images/logo.png') 0 0 no-repeat;
position: absolute;
top: 0;
left: 0;
text-indent: -9999px;
-webkit-transition: margin 200ms ease-in-out;
-moz-transition: margin 200ms ease-in-out;
-ms-transition: margin 200ms ease-in-out;
-o-transition: margin 200ms ease-in-out;
transition: margin 300ms ease-in-out;
}
.navbar-default .navbar-nav>li>a {
padding:0;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" type="text/css" rel="stylesheet">
<header class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" id="header-logo" href="http://folksverona.com/"><span>Folks Verona</span></a>
</div>
<div class="user">
<ul>
<li class="profile">
<a href="http://folksverona.com/user">
<span class="mask"><span>Profile</span></span>
</a>
</li>
<li class="cart">
<a href="http://folksverona.com/shop/cart" id="bt-cart" >
<span class="mask"><span>Cart</span></span>
<span class="num"></span>
</a>
</li>
<li class="lang hidden-xs">
<span>Help</span>
</li>
</ul>
</div>
<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="navbar-collapse collapse">
<nav class="clearfix">
<ul class="nav navbar-nav navbar-right">
<li class=""><span data-hover="Home">Home</span></li>
<li class=""><span data-hover="Shop">Shop</span></li>
<li class=""><span data-hover="Test">Test</span></li>
<li class=""><span data-hover="About">About</span></li>
<li class=""><span data-hover="Contact">Contact</span></li>
<li class="visible-xs li-language"><span data-hover="IT">IT</span></li>
</ul>
</nav>
</div>
</div>
</header>
I suggest checking out the JSFIDDLE link because it is more accurate.
Try this
body {
background-image:url('../images/geometry2.jpg');
}
.homeBody {
display:none;
}
header {
padding:0 !important;
margin:0 !important;
font-family:"Raleway", sans-serif !important;
}
header nav a {
color:#fff !important;
font-family:"Raleway", sans-serif !important;
}
.navbar-nav > li {
color:#fff !important;
font-family:"Raleway", sans-serif !important;
}
header nav li:hover a, header nav li.active a {
color:#ecf0f1 !important;
}
header nav li:hover, header nav li.active {
color:#ecf0f1 !important;
}
.navbar-default .navbar-toggle .icon-bar {
background-color:#fff;
}
.navbar-default .navbar-toggle {
border-color:#fff;
}
.linkContain {
position:absolute;
}
#media screen and (max-width: 767px) {
.navbar-nav > li, .menu-small header .navbar-nav > li, .touch header .navbar-nav > li {
background:#0e6957;
}
}
.title {
width:100%;
margin-top:120px;
text-align:center;
font-family:'Lato', sans-serif, serif;
font-size:50px;
color:#2d2d2d;
}
.images-3 {
margin-top:30px;
}
.incenseTypes {
width:80%;
margin:40px auto 0 auto;
}
.smolder {
width:80%;
margin:40px auto 0 auto;
}
.smolder img {
width:100%;
}
.view-button {
width:100%;
height:50px;
line-height:50px;
background:#16a085;
color:#fff;
font-size:24px;
}
.view-button:hover {
background:#0e6957;
}
.aboutSection {
width:80%;
margin:auto;
}
.infoTitle {
font-family:'Lato', sans-serif, serif;
}
.infoTitle2 {
font-size:35px;
font-family:'Lato', sans-serif, serif;
}
.infoBullets {
font-size:18px;
}
.infoIntro {
font-size:18px;
}
.infoLink {
color:#3aa5d2;
}
footer {
height:100px;
background:#148d75;
color:#fff;
font-size:23px;
}
footer a {
color:#fff;
}
footer a:hover {
text-decoration:none;
color:#4cbceb;
}
.copyrightRow {
margin-top:15px;
}
ul.social-buttons {
margin-top: -10px;
margin-bottom: 0;
}
.social-buttons {
text-align:center;
}
.fa-facebook {
width:50px;
height:50px;
display:block;
background-image:url('../images/home/icons/facebook.svg');
background-repeat:no-repeat;
transition:all 0.4s;
}
.fa-facebook:hover {
background-image:url('../images/home/icons/facebookHover.svg');
}
.fa-twitter {
width:50px;
height:50px;
display:block;
background-image:url('../images/home/icons/twitter.svg');
background-repeat:no-repeat;
transition:all 0.4s;
}
.fa-twitter:hover {
background-image:url('../images/home/icons/twitterHover.svg');
}
.topScentsTitle {
width:80%;
margin:auto;
text-align:center;
font-size:35px;
color:#2d2d2d;
}
.topScents {
width:80%;
margin:20px auto 0 auto;
}
.buyNow {
width:80%;
margin:auto;
height:40px;
line-height:40px;
font-size:25px;
color:#fff;
}
.buyNow {
width:80%;
margin:auto;
height:40px;
line-height:40px;
font-size:18px;
color:#fff;
background:#148d75;
border:none;
padding:0px !important;
transition:all 0.3s;
-ms-transition:all 0.3s
}
.buyNow:hover {
background:#0e6957;
}
.moreInfo {
width:80%;
margin:5px auto 0 -4px;
height:40px;
line-height:40px;
font-size:18px;
color:#fff;
background:#34495e;
padding:0px !important;
border:none;
transition:all 0.3s;
-ms-transition:all 0.3s
}
.moreInfo:hover {
background:#2c3e50;
}
.btn {
padding:0;
}
.navbar-default .navbar-nav>li>a {
padding:0;
}
a {
-webkit-transition: color 200ms linear;
-moz-transition: color 200ms linear;
transition: color 200ms linear;
}
body {
/*background:#bg-light;*/
background: #fff;
font-family: "Raleway", sans-serif;
font-size: 13px;
color: #999999;
outline: none;
}
body.home {
background: #fff;
}
*,
a,
button,
input,
*:focus,
a:focus,
button:focus,
input:focus {
outline: none!important;
}
.centered {
float: none;
margin: 0 auto;
}
.neuton {
font-family: "Neuton", serif;
}
.neuton_bold {
font-family: "Neuton", serif;
font-weight: 700;
}
.neuton_italic {
font-family: "Neuton", serif;
font-style: italic;
}
.rale {
font-family: "Raleway", sans-serif;
}
.rale_medium {
font-family: "Raleway", sans-serif;
font-weight: 500;
}
.rale_bold {
font-family: "Raleway", sans-serif;
font-weight: 700;
}
h1,
h2,
h3,
h4 {
font-family: "Neuton", serif;
color: #9a8e87;
}
h1 {
font-size: 48px;
line-height: 45px;
}
h2 {
font-size: 25px;
line-height: 22px;
}
a {
color: #666;
}
a:hover,
a:focus {
text-decoration: underline;
color: #333333;
}
.touch .touch-hide {
display: none;
}
.no-touch .touch-show {
display: none;
}
.touch .touch-show {
display: block;
}
.btn {
font-family: "Raleway", sans-serif;
font-weight: 500;
font-size: 13px;
text-transform: uppercase;
border-radius: 0;
-webkit-border-radius: 0;
padding: 15px 45px;
-webkit-transition: all 200ms linear;
-moz-transition: all 200ms linear;
transition: all 200ms linear;
background: #e2dbd7;
color: #fff;
}
.btn:hover,
.btn:focus,
.btn:active,
.btn.active,
.open .dropdown-toggle.btn {
color: #ffffff;
background-color: #b5afac;
}
.btn-red {
color: #ffffff;
background-color: #cc3300;
}
.btn-red:hover,
.btn-red:focus,
.btn-red:active,
.btn-red.active,
.open .dropdown-toggle.btn-red {
color: #ffffff;
background-color: #a32900;
}
.btn-red:active,
.btn-red.active,
.open .dropdown-toggle.btn-red {
background-image: none;
}
.form-group {
margin-bottom: 35px;
}
.control-label {
font-size: 16px;
color: #9a8e87;
font-family: "Raleway", sans-serif;
font-weight: normal;
text-transform: uppercase;
margin-bottom: 15px;
}
.form-control {
border-radius: 0;
-webkit-border-radius: 0;
background: none;
font-family: "Raleway", sans-serif;
color: #b7b7b7;
font-size: 14px;
box-shadow: none;
-webkit-box-shadow: none;
padding: 15px 10px;
height: 48px;
border: 1px solid #cac2b5;
}
.form-control:focus {
box-shadow: none;
border-color: #7c7c7c !important;
}
.form-control.required {
border-color: #cc3300!important;
border-left-width: 7px;
}
.control-label.required {
color: #cc3300;
}
.selectizer.required .selectizer-label {
border-color: #cc3300;
}
.right {
float: right;
}
.navbar-default {
height: 102px;
border-bottom: 1px solid #e9e7e6;
}
.navbar-nav > li {
-webkit-transition: all 200ms linear;
-moz-transition: all 200ms linear;
transition: all 200ms linear;
padding: 0;
}
.navbar-nav > li > a {
padding: 0;
}
header {
background: #148d75 !important;
-webkit-transition: height 200ms linear;
-moz-transition: height 200ms linear;
transition: height 200ms linear;
}
header ul {
margin: 0;
padding: 0;
}
header .navbar-collapse {
float: right;
}
header nav {
float: right;
border-right: 1px solid #E9E7E6;
/* background: #bg-light;*/
}
header nav li {
/*border-left: 1px solid rgba(229,227,225,0); border-right: 1px solid rgba(229,227,225,0);*/
/*border-bottom: 1px solid #line-light;*/
cursor: pointer;
}
header nav a {
color: #dad1cd!important;
overflow: hidden;
height: 20px;
display: inline-block;
font-size: 15px;
text-transform: uppercase;
font-weight: 600;
}
header nav a span {
position: relative;
display: inline-block;
-webkit-transition: -webkit-transform 0.3s;
-moz-transition: -moz-transform 0.3s;
transition: transform 0.3s;
}
header nav li:hover,
header nav li.active {
/*background: #nav-light-hover-bg;*/
border-left-color: #e9e7e6;
border-right-color: #e9e7e6;
/*border-bottom: 1px solid #bg-light;*/
}
header nav li:hover a,
header nav li.active a {
color: #a49993!important;
}
header nav li.active {
background: #fff;
border-left: 1px solid #e9e7e6;
border-right: 1px solid #e9e7e6;
}
header nav li:not(.active) a span::before {
position: absolute;
top: 100%;
content: attr(data-hover);
-webkit-transform: translate3d(0, 0, 0);
-moz-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
width: 100%;
text-align: center;
}
header nav li:not(.active):hover a span,
header nav li:not(.active) a:focus span {
/* -webkit-transform: translatey(-100%);
-moz-transform: translatey(-100%);
transform: translatey(-100%);*/
}
header .user {
float: right;
}
header .user li {
list-style: none;
float: left;
border-right: 0;
}
header .user li a {
height: 102px;
padding: 0 15px;
display: inline-block;
padding-top: 43px;
font-weight: 600;
font-size: 15px;
text-decoration: none!important;
}
header .user li a .mask {
width: 16px;
height: 16px;
overflow: hidden;
display: inline-block;
}
header .user li a .mask span {
display: block;
width: 16px;
height: 32px;
text-indent: -9999px;
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
-webkit-transform: translate(0px, 0px);
-moz-transform: translate(0px, 0px);
transform: translate(0px, 0px);
transition-delay: .05s;
-webkit-transition-delay: .05s;
}
header .user li a .num {
color: #cc3300;
}
header .user li a:hover .mask span,
header .user li a.active .mask span {
transition-delay: 0;
-webkit-transition-delay: 0;
-webkit-transform: translate(0px, -16px);
-moz-transform: translate(0px, -16px);
transform: translate(0px, -16px);
/*margin-top: -16px*/
}
header .user li.profile {
margin-right: 2px;
}
header .user li.profile a .mask span {
background: url('../images/header-user-light.png') 0 0 no-repeat;
}
header .user li.cart a .mask span {
background: url('../images/header-cart-light.png') 0 0 no-repeat;
}
header .user li.cart a.active .mask span {
background-image: url("../images/header-cart-light-active.png");
}
header .user li.lang a {
padding-top: 20px;
padding-right: 0;
-webkit-transition: padding-top 200ms linear;
-moz-transition: padding-top 200ms linear;
transition: padding-top 200ms linear;
}
header .user li.lang span {
display: inline-block;
width: 60px;
height: 60px;
line-height: 60px;
border: 1px solid #e9e7e6;
text-align: center;
color: #e9e7e6;
-webkit-transition: all 200ms linear;
-moz-transition: all 200ms linear;
transition: all 200ms linear;
}
header .user li.lang span:hover {
color: #a49993;
text-decoration: none;
border-color: #a49993;
}
.navbar-nav > li.li-language,
.touch header .navbar-nav > li.li-language {
border-top: 1px solid #f0edeb !important;
}
.home.menu-abs header {
position: absolute;
top: 0 !important;
}
.navbar-collapse.in nav,
.navbar-collapse.collapsing nav {
float: none;
border-right: none;
padding-right: 0;
height: auto;
}
.navbar-default .navbar-nav > .disabled > a,
.navbar-default .navbar-nav > .disabled > a:hover,
.navbar-default .navbar-nav > .disabled > a:focus {
color: #bfb6b1;
}
.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
color: #a49993;
}
.navbar-nav > li:last-child {
border-right: 0;
}
.navbar-collapse .navbar-nav.navbar-right:last-child {
margin-right: 0;
}
#header-logo {
display: block;
width: 170px;
height: 102px;
float: left;
position: relative;
overflow: hidden;
background: none;
margin-top: 0px;
margin-bottom: 0px;
margin-left: 0;
padding: 0;
-webkit-transition: height 200ms linear;
-moz-transition: height 200ms linear;
transition: height 300ms linear;
}
#header-logo span {
display: block;
width: 170px;
height: 102px;
z-index:-1;
position: relative;
background: url('../images/logo.png') 0 0 no-repeat;
position: absolute;
top: 0;
left: 0;
text-indent: -9999px;
-webkit-transition: margin 200ms ease-in-out;
-moz-transition: margin 200ms ease-in-out;
-ms-transition: margin 200ms ease-in-out;
-o-transition: margin 200ms ease-in-out;
transition: margin 300ms ease-in-out;
}
.navbar-default .navbar-nav>li>a {
padding:0;
}
.navbar-default .navbar-nav > li > a {
color: #777;
display: block;
height: auto;
margin: 0;
width: 100%;
}
.nav.navbar-nav.navbar-right span {
padding: 40px;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" type="text/css" rel="stylesheet">
<header class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" id="header-logo" href="http://folksverona.com/"><span>Folks Verona</span></a>
</div>
<div class="user">
<ul>
<li class="profile">
<a href="http://folksverona.com/user">
<span class="mask"><span>Profile</span></span>
</a>
</li>
<li class="cart">
<a href="http://folksverona.com/shop/cart" id="bt-cart" >
<span class="mask"><span>Cart</span></span>
<span class="num"></span>
</a>
</li>
<li class="lang hidden-xs">
<span>Help</span>
</li>
</ul>
</div>
<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="navbar-collapse collapse">
<nav class="clearfix">
<ul class="nav navbar-nav navbar-right">
<li class=""><span>Home</span></li>
<li class=""><span>Shop</span></li>
<li class=""><span>Test</span></li>
<li class=""><span>About</span></li>
<li class=""><span>Contact</span></li>
<li class="visible-xs li-language"><span>IT</span></li>
</ul>
</nav>
</div>
</div>
</header>

CSS Force nested child behind parent with position:fixed

I have a fixed menu bar that contains a simple <ul> <li> menu system. Upon li:hover I have a sub-menu system aside appear, and this is relative to each li. Unfortunately this aside is always appearing on top of all of the parents.
When I actually want it to be positioned behind the div#sidebar. Is this possible? I have not had much luck with z-index (including -1), any help would be appreciated!
<div id="sidebar">
<nav class="secondary">
<h2>Featured</h2>
<ul>
<li>
<a href="#">
<h3>Title</h3>
</a>
<aside class="article-card">
<h4>TITLE</h4>
<h5>TEXT</h5>
</aside>
</li>
</ul>
</nav>
</div>
ul {
list-style: none;
display: inline-block;
width: 59.6%;
margin-right: 9.1%;
float: right;
margin-bottom: 40px;
}
li {
display: block;
margin-bottom: 10px;
-webkit-transition: all 1s ease-in-out;
-moz-transition: all 1s ease-in-out;
-ms-transition: all 1s ease-in-out;
-o-transition: all 1s ease-in-out;
transition: all 1s ease-in-out;
}
#sidebar {
background: #253e40;
color: #8b8c91;
width: 215px;
height: 100%;
position: fixed;
top: 0;
bottom: 0;
right: 215px;
margin-right: -215px; /* "#sidebar" width */
z-index: 3;
}
#sidebar.active { margin-right: 0; }
#sidebar header {
font-weight: bold;
padding: 30px 20px 50px 20px;
border-bottom: 1px solid #8b8c91;
color: #8b8c91;
}
#sidebar footer {
background: none;
bottom: 40px;
padding: 0 20px;
position: absolute;
}
/* Nav */
#sidebar nav {
width: 100%;
margin: 20px 0 50px 0;
display: inline-block;
}
#sidebar ul {
width: 100%;
margin: 0;
}
#sidebar li {
margin-bottom: 0;
padding: 2px 20px;
}
#sidebar li:before {
content: none;
padding: 0;
}
.current-menu-item {
font-weight: bold;
color: #fff;
}
#sidebar a:hover {
color: #fff;
}
#sidebar nav.secondary h2 {
font-weight: bold;
color: #fff;
padding: 0 20px 15px 20px;
border-bottom: 1px solid #8b8c91;
}
#sidebar nav.secondary li {
padding: 15px 20px;
border-bottom: 1px solid #8b8c91;
}
#sidebar nav.secondary li:hover {
background: #252f37;
color: #fff;
}
/* Article Card Popout */
.article-card {
position: absolute;
background-color: #44484f;
display: inline-block;
width: 200px;
height: auto;
right: 15px;
border-left: 5px solid #be572b;
}
#sidebar nav.secondary li:hover .article-card {
right: 215px;
}
.article-card h4 {
font-weight: bold;
padding: 10px;
}
.article-card h5 {
color: #fff;
padding: 10px;
}
/* Transition animations */
#sidebar,
.article-card {
-webkit-transition: all 0.7s ease-in-out;
-moz-transition: all 0.7s ease-in-out;
-ms-transition: all 0.7s ease-in-out;
-o-transition: all 0.7s ease-in-out;
transition: all 0.7s ease-in-out;
}
Fiddle
If you really want to keep that html, you need to create a new stacking context. #sidebar has position:fixed - elements inside sidebar are treated with a new stacking context that now begins at #sidebar and not at body level any more.
Children of the sidebar cannot be positioned below #sidebar.
To solve this add another container inside sidebar that contains all the background styling and is inside the same stacking context as your slideout.
ul {
list-style: none;
display: inline-block;
width: 59.6%;
margin-right: 9.1%;
float: right;
margin-bottom: 40px;
}
li {
display: block;
margin-bottom: 10px;
-webkit-transition: all 1s ease-in-out;
-moz-transition: all 1s ease-in-out;
-ms-transition: all 1s ease-in-out;
-o-transition: all 1s ease-in-out;
transition: all 1s ease-in-out;
}
#sidebar {
background: #253e40;
color: #8b8c91;
width: 215px;
height: 100%;
position: fixed;
top: 0;
bottom: 0;
right: 215px;
margin-right: -215px; /* "#sidebar" width */
z-index: 3;
}
#sidebar.active { margin-right: 0; }
.sidebar-content {
height: 100%;
background: #253e40;
}
#sidebar header {
font-weight: bold;
padding: 30px 20px 50px 20px;
border-bottom: 1px solid #8b8c91;
color: #8b8c91;
}
#sidebar footer {
background: none;
bottom: 40px;
padding: 0 20px;
position: absolute;
}
/* Nav */
#sidebar nav {
width: 100%;
margin: 20px 0 50px 0;
display: inline-block;
}
#sidebar ul {
width: 100%;
margin: 0;
}
#sidebar li {
margin-bottom: 0;
padding: 2px 20px;
}
#sidebar li:before {
content: none;
padding: 0;
}
.current-menu-item {
font-weight: bold;
color: #fff;
}
#sidebar a:hover {
color: #fff;
}
#sidebar nav.secondary h2 {
font-weight: bold;
color: #fff;
padding: 0 20px 15px 20px;
border-bottom: 1px solid #8b8c91;
}
#sidebar nav.secondary li {
padding: 15px 20px;
border-bottom: 1px solid #8b8c91;
}
#sidebar nav.secondary li:hover {
background: #252f37;
color: #fff;
}
/* Article Card Popout */
.article-card {
position: absolute;
z-index: -1; // z index put's it below .sidebar-content
background-color: #44484f;
display: inline-block;
width: 200px;
height: auto;
right: 15px;
border-left: 5px solid #be572b;
}
#sidebar nav.secondary li:hover .article-card {
right: 215px;
}
.article-card h4 {
font-weight: bold;
padding: 10px;
}
.article-card h5 {
color: #fff;
padding: 10px;
}
/* Transition animations */
#sidebar,
.article-card {
-webkit-transition: all 0.7s ease-in-out;
-moz-transition: all 0.7s ease-in-out;
-ms-transition: all 0.7s ease-in-out;
-o-transition: all 0.7s ease-in-out;
transition: all 0.7s ease-in-out;
}
<div id="sidebar">
<div class="sidebar-content">
<nav class="secondary">
<h2>Featured</h2>
<ul>
<a href="#">
<li>Title
<aside class="article-card">
<h4>TITLE</h4>
<h5>TEXT</h5>
</aside>
</li>
</a>
</ul>
</nav>
</div>
</div>

Issue with drop down menu

I have created a menu and i am trying to implement a drop down menu on hover, It doesn't seem to appear correct,any help would be appreciated. Why is the drop down appearing in different position ?
<ul class="menu">
<li>Home
<ul class="menu">
<li>Home</li></ul>
</li> |
<li class="active">About</li> |
<li>Products</li> |
<li>Clients</li> |
<li>Reach Us</li>
<div class="clear"></div>
</ul>
.menu{
float:left;
color: #555555;
margin-top: 25px;
}
.menu ul {}
.menu li{
display: inline-block;
margin:6px 20px;
}
.menu li a{
display: block;
color: #000;
line-height: 1.8em;
text-transform: capitalize;
font-size: 14px;
font-weight: 400;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
padding: 5px;
}
.menu li:hover > ul {
display: block;
}
.menu li.active a{
color: #52ABDF;
background: white;
}
.menu li a:hover{
color: #ooo;
background: #52ABDF;
padding: 5px;
}
.menu li ul{
display: none;
}
.menu ul li:hover ul{
display: block;
margin-left:0px;
}
.menu li ul li {
float: none;
display: inline;
}
.menu li ul li a {
position: relative;
border-left: 1px solid black;
border-right: 1px solid black;
border-bottom: 1px solid black;
background: #333;
color: #ooo;
}
.menuli ul li a:hover {
background: #066;
color: #000;
}
Here is the code pen : http://codepen.io/anon/pen/EtmAB
As a tip,
you should never use '|' symbol to seperate the <li>s, because it
makes the html meaningless. The <ul> tag is expected to have only
<li> tags as its children.. You could use the border-right property instead. and use
ul li:last-of-type(){
border: 0;
}
to eliminate the border on the last <li>
Use this css and yours would work:
.menu,
.menu li ul{
float:left;
color: #555555;
margin-top: 0;
list-style: none;
padding: 0;
}
.menu{
margin-top: 25px;
}
.menu ul:after{
content: "";
display: block;
clear: both;
}
.menu li{
float: left;
position: relative;
}
.menu li a{
display: block;
color: #000;
line-height: 2em;
text-transform: capitalize;
font-size: 14px;
font-weight: 400;
padding: 0 20px;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
.menu li:hover > ul {
display: block;
}
.menu li.active a{
color: #52ABDF;
background: white;
}
.menu li a:hover{
color: #ooo;
background: #52ABDF;
}
.menu li ul{
display: none;
position: absolute;
background: #bbb;
}
.menu li ul li {
display: inline ;
}
.menu li ul li a {
position: relative;
border-left: 1px solid black;
border-right: 1px solid black;
border-bottom: 1px solid black;
background: #333;
color: #ooo;
}
.menuli ul li a:hover {
background: #066;
color: #000;
}
If you want to really learn how to make a better styled dropdown menu, use this tutorial:
http://andornagy.com/css-dropdown-menu/
it is pretty easy and understandable too, and not bad looking...

Nav dropdown freaks out and shows different tabs

I'm trying to create a navbar (already done) with a dropdown, but the dropdown keeps spazzing out when I hover over it :(
I made a JS Fiddle of what I've accomplished so far, and I was hoping for some help!
http://jsfiddle.net/kkpp6/
I think it might be due to the display: none; I used in one of the ul's or possibly due to a stupid typo but I can't figure out where!
As well as this, I can't figure out how to make a sub-menu for my sub-menus that already exist.. (so the desc tab has a submenu of swim squad which will also have a sub-menu of other things).. How would I do that? I can't figure out where I would start!
Cheers for all the help in advance!
Try like this: LINK
CSS:
.nav-wrap {
background-color: #125CC1;
text-align: center;
}
ul.navigation-bar li a {
color: #FFFFFF;
background-color: #125CC1;
text-align: center;
padding: 6px;
font-size: 12px;
text-decoration: none;
text-transform: uppercase;
}
ul.navigation-bar li a:hover {
background-color: #06398F;
}
ul.navigation-bar {
text-align: left;
display: inline;
margin: 0;
list-style: none;
}
ul.navigation-bar li {
line-height:28px;
margin-right: -4px;
position: relative;
display: inline-block;
width: 120px;
font-weight: bold;
color: #FFFFFF;
background-color: #125CC1;
text-align: center;
}
ul.navigation-bar li ul {
padding: 0;
position: absolute;
top: 28px;
left: 0;
width: 120px;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
display: none;
opacity: 0;
visibility: hidden;
-webkit-transiton: opacity 0.2s;
-moz-transition: opacity 0.2s;
-ms-transition: opacity 0.2s;
-o-transition: opacity 0.2s;
-transition: opacity 0.2s;
}
ul.navigation-bar li ul li {
background: #125CC1;
display: block;
color: #fff;
}
ul.navigation-bar li ul li:hover {
background: #06398F;
color: #fff;
}
ul.navigation-bar li:hover ul {
display: block;
opacity: 1;
visibility: visible;
}
Updated fiddle LINK
Multi-level dropdown menu LINK
On line 38, you set a list to display when the user hovers over a list item. This makes it visible, but also causes the entire menu to shift over so that you're no longer hovering over the list item that triggered that. If you use position:absolute on the list, it won't affect the other elements on the page:
ul.navigation-bar li > ul {
position:absolute;
}
JSFiddle: http://jsfiddle.net/P9SUg/
I also think its because of display:none;, instead of display:none; you should use visibility:hidden;.
and also add
ul.navigation-bar li > ul {
position:absolute;
}
You need to do lot of changes in CSS for making dropdown menu.
.nav-wrap {
background-color: #125CC1;
text-align: center;
}
ul.navigation-bar {
list-style-type: none;
margin: 0;
padding: 0;
}
ul.navigation-bar > li {
display: inline;
position:relative;
}
ul.navigation-bar > li > a {
display: inline-block;
width: 120px;
font-weight: bold;
color: #FFFFFF;
background-color: #125CC1;
text-align: center;
padding: 4px;
font-size: 12px;
text-decoration: none;
text-transform: uppercase;
-webkit-transition: all 0.15s linear;
-moz-transition: all 0.15s linear;
-o-transition: all 0.15s linear;
transition: all 0.15s linear;
}
ul.navigation-bar > li > a:hover {
background-color: #06398F;
}
ul.navigation-bar ul {
display: none;
}
ul.navigation-bar li:hover > ul {
display: block;
position:absolute;
top:23px;
background-color:#ff00ff;
z-index:10;
width:100%;
list-style-type: none;
margin: 0;
padding: 0;
}
ul.navigation-bar li ul li a
{
list-type:none;
text-align: left;
font-weight:normal;
padding: 4px;
font-size: 10px;
text-decoration: none;
text-transform: uppercase;
-webkit-transition: all 0.15s linear;
-moz-transition: all 0.15s linear;
-o-transition: all 0.15s linear;
transition: all 0.15s linear;
}
ul.navigation-bar li ul li:hover
{
background-color:#000;
}
ul.navigation-bar li ul li:hover a
{
color:#fff;
}
FIDDLE DEMO