Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
kamen499843dIt probably has a height of 0 for some reason.
akshar246342dMaybe the div isn't your nearest relative
M1sf3t462742dusually happens when you forget to set position to something other than static.
hjk101233742dAbsolute position -1000
Display none (any js sprinkling some magic)
Other z-index takes precedence (it's not highest number wins, cascading can be a bitch) for instance more specific, !important or even inline.
Z index is only a tiny part of the display capabilities or messup you can do.
When writing from scratch I use tens as z-indecies.
Usually i only need -10 for below sone transparent stuff. 0 for normal elements 10 for dialog, 20 for overlay mask. 30 for overlay dialog. 40 for floating bars. If i need to cram something in I do 5. Like a text balloon on dialog 15.
jschmold12042dWhenever this happens, I always check the width/height. Often for whatever reason, it won't know I am expecting it to at least be the minimum width. Usually start with width: min-content