html - making a box-shadow stay above a ul element on hover -
in project of mine i'm perfecting navbar, can see ordering menu item has test drop down menus, have hover , active class of blue box-shadow, box-shadow doesn't render on new menu list, z-index's of 9999 first li , 999 second, still renders on box shadow.
here's js fiddle.
https://jsfiddle.net/ybarpz3x/25/
thank you! nav css
nav { position: fixed; background-color: #fff; width: 100vw; z-index: 999; } nav ul { float: right; font-size: 0px; padding: 0; margin: 0; color: #337ab7; position: relative; z-index: 9999; } nav ul .current-top-menu-item { box-shadow: 0px 4px 0px #36b8c8; } nav ul .current-top-menu-item { color: #204e76; } nav ul .top-menu-collapsed { padding: 20px 19px; } nav ul * { -webkit-transition: 170ms ease-out; -moz-transition: 170ms ease-out; -ms-transition: 170ms ease-out; transition: 170ms ease-out; } nav ul li { display: inline-block; font-family: "raleway", sans-serif; text-decoration: none; font-size: 1.6rem; text-transform: capitalize; font-weight: 600; position: relative; padding: 30px 24px; z-index: 9999; } nav ul li { position: static; } nav ul li a:hover, nav ul li a:active, nav ul li a:focus, nav ul li a:visited { text-decoration: none; } nav ul li div { position: absolute; top: 0; left: 0; z-index: 666666; width: auto; height: auto; margin: 22px 24px; padding: 0; background-color: rgba(0, 0, 0, 0.5); } nav ul li ul { display: none; position: absolute; top: 100%; left: 0; background: #fff; padding: 0; width: 100%; z-index: 999; } nav ul li ul li { z-index: 999; text-align: center; float: none; width: 100%; padding: 8px 0px; display: block; } nav ul li:hover, nav ul li:active { z-index: 9999; cursor: hand; box-shadow: 0px 4px 0px #36b8c8; } nav ul li:hover a, nav ul li:active { color: #204e76; } nav ul li:hover ul, nav ul li:active ul { display: block; } nav ul li.active:after { box-shadow: 0px 4px 0px #36b8c8; } nav ul li.active:after { color: #204e76; } nav div { text-align: left; position: relative; padding-left: 70px; font-weight: 600; font-size: 3.8rem; font-family: "raleway", sans-serif; color: #337ab7; float: left; } nav div a:hover, nav div :active, nav div :focus { color: #204e76; text-decoration: none; cursor: hand; }
simply add margin-top nav ul li ul style
nav ul li ul { margin-top: 4px; }
Comments
Post a Comment