26
Comments
  • 2
    It probably has a height of 0 for some reason.
  • 2
    Maybe the div isn't your nearest relative
  • 1
    Absolute 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.
  • 1
    Whenever 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
Add Comment