html - CSS Z-Index layering issue -


i got nice idea webpage layout , started design code it. , when done menu, thought yiha! after few moments noticed .menu-item going top of page going behind .logo class if has higher z-index.

here sass cutout:

    li.menu-item       list-style: none       position: absolute       z-index: 200        &:hover >         background-color: #a82929         box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.5)         margin-right: 0px                text-decoration: none         color: #ffffff         box-sizing: border-box         padding: 0px 8px 0px 8px         margin-right: 22px         transition: 0.4s ease-in-out         position: relative         z-index: 300 

link codepen

tried watch videos z-index, amongst them 1 css-tricks, still don't work want. me stackoverflooooow, hope...

i guess problem this:

.menu-box has z-index of 20.

.logo-box has z-index of 40.

and both have position: relative; therefore, inside 2 "layered" inside two, individually. nothing in .menu-box go above .logo-box because of z-index's mentioned above. inside "layered" inside these 2 parent boxes, z-index's of inside elements matter inside parent elements.

i leave here: http://philipwalton.com/articles/what-no-one-told-you-about-z-index/


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -